﻿/* Small Mobile Layout (≤ 480px) */
/* Mobile Layout (≤ 768px) */
/* Tablet Layout (768px - 1024px) */
/* Desktop Layout (> 1024px) */


/* ==========================================================================
   Base Styles (All devices)
   ========================================================================== */

/* Sort and Filter Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3436;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #636e72;
    padding: 0.25rem;
}

.modal-close:hover {
    color: #2d3436;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3436;
}

.sort-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f5f5f7;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sort-option:hover {
    background-color: #e5e5e7;
}

.sort-option.active {
    background-color: #0095ff;
    color: white;
}

.sort-direction {
    font-weight: bold;
    font-size: 1.25rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-option {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-option label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #636e72;
}

.filter-option input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.filter-option input:focus {
    border-color: #0095ff;
    outline: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal-footer button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.modal-footer .secondary-button {
    background-color: #f5f5f7;
    color: #2d3436;
}

.modal-footer .secondary-button:hover {
    background-color: #e5e5e7;
}

.modal-footer .primary-button {
    background-color: #0095ff;
    color: white;
}

.modal-footer .primary-button:hover {
    background-color: #0077cc;
}

/* Item Card */
.item-card {
    background: white;
    margin-bottom: .5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.3s ease;
    opacity: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: grid;
    padding: 1.5rem;
    border-radius: 12px;
    grid-template-rows: auto auto auto;
    gap: 1rem;
    position: relative;
}

.item-card.picked {
    opacity: 0.5;
    background-color: #f8f9fa;
}

.item-card.removing {
    opacity: 0;
    transform: translateX(-100%);
}

.item-card.queued {
    background-color: rgba(128, 90, 213, 0.1);
}

.item-card.queued .pick-button {
    background-color: #805AD5;
    color: white;
}

.item-card.menu-open {
    z-index: 50;
}

.item-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: #2d3436;
    word-break: break-word;
    overflow-wrap: break-word;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    text-align: center;
}

/* New unified item-content grid */
.item-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "image quantity actions"
        "location location location"
        "sku sku sku";
    gap: 0.75rem;
    align-items: center;
}

.item-image {
    grid-area: image;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-quantity {
    grid-area: quantity;
    font-size: 3rem;
    font-weight: 800;
    color: #2d3436;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-actions {
    grid-area: actions;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.item-identifiers {
    grid-area: sku;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0 0.25rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.item-sku {
    font-size: 1.65rem;
    color: #000000;
    font-weight: 600;
    line-height: 1.1;
}

.item-barcode {
    font-size: 0.95rem;
    color: #000000;
    font-weight: 500;
    line-height: 1.1;
    word-break: break-all;
}

.item-location {
    grid-area: location;
    font-size: 1.2rem;
    color: #000000;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
}

.item-location[data-length-range="tiny"] {
    font-size: 2.5rem;
    letter-spacing: 0.2px;
}

.item-location[data-length-range="short"] {
    font-size: 2rem;
    letter-spacing: 0.5px;
}

.item-location[data-length-range="medium"] {
    font-size: 1.8rem;
    letter-spacing: 0.3px;
}

.item-location[data-length-range="long"] {
    font-size: 1.2rem;
    letter-spacing: 0.2px;
    word-break: break-all;
}

.pick-button {
    background-color: #0095ff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pick-button:hover {
    background-color: #0077cc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pick-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.pick-button.is-bundle:not(.picked):not(.queued) {
    background-color: #4CAF50;
}

.pick-button.is-bundle:not(.picked):not(.queued):hover {
    background-color: #45a049;
}

.pick-button.picked {
    background-color: #e0e0e0;
    color: #636e72;
}

.pick-button.picked:hover {
    background-color: #d0d0d0;
}

.order-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
        "order more status"
        "stock stock stock";
    gap: 0.35rem 1rem;
    align-items: start;
    position: relative;
    margin-top: 0.25rem;
}

.order-actions {
    grid-area: order;
    justify-self: start;
    align-self: start;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.on-hand {
    grid-area: more;
    justify-self: center;
    align-self: start;
    text-align: center;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}

.status-wrapper {
    grid-area: status;
    justify-self: end;
    align-self: start;
}

.stock-values {
    grid-area: stock;
    justify-self: center;
    text-align: center;
    min-width: 0;
    max-width: 100%;
    color: #333;
    font-weight: 500;
    font-size: 1.125rem;
    white-space: nowrap;
}

.order-number {
    text-decoration: none;
    color: #0095ff;
    text-align: left;
    font-weight: 700;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 700;
}

.order-number:hover {
    color: #0055cc;
    text-decoration: underline;
}

.order-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.35rem;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 170px;
    z-index: 200;
}

.order-menu.show {
    display: block;
}

.order-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    color: #2d3436;
    text-decoration: none;
    font-size: 0.95rem;
}

.order-menu-item:hover {
    background-color: #f5f5f5;
}

.item-more-actions {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 12rem;
}

.item-more-button {
    width: 100%;
    min-width: 7rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3436;
    background: #f1f3f5;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
}

.item-more-button:hover {
    background: #e9ecef;
}

.item-more-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.35rem;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 180px;
    max-height: min(70vh, 320px);
    overflow-y: auto;
    z-index: 200;
}

.item-more-menu.show {
    display: block;
}

.item-more-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    color: #2d3436;
    font-size: 0.95rem;
}

.item-more-menu-item:hover {
    background-color: #f5f5f5;
}

.item-more-menu-item.missing-data {
    color: #ff4d4d;
    font-weight: 600;
}

.item-more-menu-item.bundle-menu-item {
    color: #4CAF50;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}

.item-more-menu-item.bundle-menu-item:hover {
    background-color: #e8f5e8;
    color: #45a049;
}

/* Confirm count choice buttons */
.confirm-count-choice {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.confirm-count-correct,
.confirm-count-incorrect {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.confirm-count-correct {
    background: #2e7d32;
    color: #fff;
    border-color: #1b5e20;
}

.confirm-count-correct:hover:not(:disabled) {
    background: #256b29;
}

.confirm-count-incorrect {
    background: #fff;
    color: #c62828;
    border-color: #e57373;
}

.confirm-count-incorrect:hover:not(:disabled) {
    background: #fdecea;
}

.confirm-count-correct:disabled,
.confirm-count-incorrect:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.confirm-count-popup .back-button {
    background: none;
    border: 1px solid #ddd;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.confirm-count-popup .back-button:hover:not(:disabled) {
    background-color: #f5f5f5;
}

.confirm-count-qty-step {
    margin-top: 0.25rem;
}

/* Pick Controls */
.pick-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

.pick-controls .split-button-container {
    flex: 1;
    /* Take up available space in the pick-controls */
    max-width: 100%;
    /* Ensure it doesn't overflow its container */
}

.pick-controls button {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
    text-align: center;
    border: none;
}

/* Connection state display (not an action) */
.pick-controls .primary-button {
    color: white;
    position: relative;
    pointer-events: none;
    cursor: default;
}

.pick-controls .primary-button:hover,
.pick-controls .primary-button:disabled {
    transform: none;
    box-shadow: none;
    cursor: default;
}

.pick-controls .primary-button.is-connecting:disabled {
    background-color: #ffa000;
    color: white;
}

.pick-controls .primary-button.is-connected:disabled {
    background-color: #28a745;
    color: white;
}

.pick-controls .primary-button.is-refreshing:disabled,
.pick-controls .primary-button.syncing {
    background-color: #2f6fed;
    color: white;
    padding-right: 2.5rem;
}

.pick-controls .primary-button.is-disconnected:disabled {
    background-color: #dc3545;
    color: white;
}

.pick-controls .primary-button.syncing::after {
    content: '';
    position: absolute;
    width: 1em;
    height: 1em;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-spinner 1s linear infinite;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes button-spinner {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.pick-controls .secondary-button {
    background-color: #f5f5f7;
    color: #2d3436;
}

.pick-controls .secondary-button:hover {
    background-color: #e5e5e7;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pick-controls .secondary-button.active {
    background-color: #2d3436;
    color: white;
}

.pick-controls button:active {
    transform: translateY(0);
    box-shadow: none;
}

.pick-location-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex: 1 1 100%;
    width: 100%;
    order: 20;
}

.pick-location-control[hidden] {
    display: none !important;
}

.pick-location-label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.pick-location-select {
    min-width: 10rem;
    max-width: 16rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 0.9rem;
}

.pick-location-select:disabled {
    background: #f5f5f5;
    color: #555;
    cursor: default;
    opacity: 1;
}

.pick-location-control .secondary-button {
    white-space: nowrap;
}

.pick-location-scan-input,
.pick-location-control .inline-scan-row > .pick-location-scan-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pick-location-control .inline-scan-row {
    width: auto;
    flex: 0 0 auto;
}

.pick-location-control .inline-scan-btn {
    width: 2.35rem;
    min-height: 2.15rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

.pick-location-control .inline-scan-panel {
    flex: 1 1 100%;
    width: 100%;
    margin: 0.35rem 0 0;
}

.last-sync {
    flex: 1 1 100%;
    width: 100%;
    order: 10;
    margin: 0.25rem 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color, #e5e5e7);
    font-size: 0.9rem;
    color: #636e72;
    text-align: center;
    line-height: 1.3;
    min-width: 0;
}

.last-sync-time {
    display: block;
    margin-top: 0.15rem;
    min-width: 0;
    text-align: center;
    color: #636e72;
}

/* Count Display */
.count-display-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
    min-width: 120px;
    flex: 1 1 100%;
    order: 30;
}

.count-display {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    font-size: 0.9rem;
    color: #636e72;
    text-align: right;
    justify-content: flex-end;
}

.count-display--filtered {
    font-size: 0.8rem;
    color: #7b8287;
}

.count-display--filtered .filter-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a0a5aa;
}

.count-display span {
    white-space: nowrap;
}

.count-display span span {
    font-weight: 600;
    color: #2d3436;
}

.count-display .item-count::after {
    content: '|';
    margin-left: 1rem;
    color: #ddd;
}

/* Location Edit Popup */
.location-edit-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.popup-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 400px;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.popup-content h3 {
    margin: 0;
    color: #2d3436;
    font-size: 1.2rem;
}

.location-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.location-input:focus {
    outline: none;
    border-color: #0095ff;
    box-shadow: 0 0 0 2px rgba(0, 149, 255, 0.1);
}

.popup-buttons {
    display: flex;
    gap: 0.75rem;
}

.popup-buttons button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-button {
    background: none;
    border: 1px solid #ddd;
    color: #666;
}

.cancel-button:hover {
    background-color: #f5f5f5;
}

.save-button {
    background-color: #0095ff;
    border: none;
    color: white;
}

.save-button:hover {
    background-color: #0077cc;
}

/* Kebab Menu */
.kebab-menu {
    position: absolute;
    top: 16px;
    left: 8px;
    z-index: 10;
}

.kebab-menu-button {
    position: relative;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.kebab-menu-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.kebab-menu-button .dot {
    width: 4px;
    height: 4px;
    background-color: #666;
    border-radius: 50%;
}

.kebab-menu-content {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
    min-width: 150px;
    z-index: 1000;
}

.kebab-menu-content.show {
    display: block;
}

.kebab-menu-content .menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
}

.kebab-menu-content .menu-item:hover {
    background-color: #f5f5f5;
}

.kebab-menu-content .menu-item.missing-data {
    color: red;
    font-weight: 600;
}

/* Vertical Kebab Menu for Item Cards (Find-Quick still uses these classes) */
.item-kebab-menu,
.item-card-indicators {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
    min-width: 24px;
    min-height: 24px;
}

.kebab-menu-button.vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.kebab-menu-button.vertical .dot {
    width: 6px;
    height: 6px;
    background-color: #333;
    border-radius: 50%;
    margin: 0px 0;
}

.kebab-menu-content.vertical {
    position: absolute;
    left: 100%;
    top: 0;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 5px 0;
    min-width: 160px;
    display: none;
}

.kebab-menu-content.vertical.show {
    display: block;
}

.kebab-menu-content.vertical .menu-item {
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
}

.kebab-menu-content.vertical .menu-item:hover {
    background-color: #f5f5f5;
}

.kebab-menu-content.vertical .menu-item.missing-data {
    color: #ff4d4d;
    font-weight: bold;
}

.kebab-menu-content.vertical .menu-item.bundle-menu-item {
    color: #4CAF50;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 4px;
    padding-bottom: 12px;
}

.kebab-menu-content.vertical .menu-item.bundle-menu-item:hover {
    background-color: #e8f5e8;
    color: #45a049;
}

/* Items Grid */
.items-grid {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
    min-height: 200px;
}

.no-orders-message {
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    min-height: 200px;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
    color: #636e72;
    font-size: 1rem;
    text-align: center;
}

/* Missing Info Indicator */
.missing-info-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    background-color: red;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 1;
}

.missing-info-indicator.show-indicator {
    display: flex;
}

/* Bundle Indicator (legacy; pick cards use green Bundle button instead) */
.bundle-indicator {
    position: absolute;
    top: 0;
    left: 20px;
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
}

.item-card-indicators .bundle-indicator:only-child,
.item-card-indicators .missing-info-indicator:not(.show-indicator) + .bundle-indicator {
    left: 0;
}

.bundle-indicator:hover {
    background-color: #45a049;
}

/* Bundle Modal Styles */
.bundle-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
    padding: 2.75rem 1rem 1.5rem;
    padding-top: max(2.75rem, calc(env(safe-area-inset-top, 0px) + 1.75rem));
    overflow-y: auto;
}

.bundle-modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
}

.bundle-modal-content.bundle-complete {
    border: 2px solid #4caf50;
    box-shadow: 0 4px 24px rgba(76, 175, 80, 0.35);
}

.bundle-modal-content.bundle-complete .bundle-modal-header {
    background-color: #e8f5e9;
}

.bundle-modal-content.bundle-complete .bundle-modal-header h3 {
    color: #2e7d32;
}

.bundle-complete-banner {
    background-color: #4caf50;
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.bundle-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.bundle-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.bundle-modal-close {
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    transition: color 0.2s ease;
}

.bundle-modal-close:hover {
    color: #333;
}

.bundle-modal-body {
    padding: 1.5rem;
}

.bundle-modal-body h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.bundle-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bundle-item {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bundle-item-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.bundle-item-quantity {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.bundle-item-sku {
    color: #888;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

/* Bundle Table Styles */
.bundle-table-container {
    margin-top: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.bundle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.bundle-table thead {
    background-color: #f8f9fa;
}

.bundle-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.bundle-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.bundle-table tr:last-child td {
    border-bottom: none;
}

.bundle-table tr:hover {
    background-color: #f8f9fa;
}

.bundle-title {
    font-weight: 500;
    color: #333;
}

.bundle-sku {
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 1.05rem;
}

.bundle-location {
    color: #0095ff;
    font-weight: 500;
}

.bundle-quantity {
    text-align: center;
    font-weight: 600;
    color: #333;
}

/* Bundle pick action */
.bundle-pick-action {
    text-align: center;
}

/* Bundle image container - hidden on desktop table view */
.bundle-image-container {
    display: none;
}

.bundle-pick-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #0095ff;
    color: white;
    min-width: 80px;
}

.bundle-pick-btn:hover {
    background-color: #0077cc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bundle-pick-btn:active {
    transform: translateY(0);
}

.bundle-pick-btn.picked {
    background-color: #4caf50;
}

.bundle-pick-btn.picked:hover {
    background-color: #45a049;
}

.bundle-pick-btn.queued {
    background-color: #805AD5;
    color: white;
}

.bundle-pick-btn.queued:hover {
    background-color: #6B46C1;
    transform: none;
    box-shadow: none;
}

.bundle-pick-btn:disabled {
    cursor: wait;
    opacity: 0.95;
}

.bundle-item-row.picked {
    background-color: #f1f8f4;
}

.bundle-item-row.queued {
    background-color: rgba(128, 90, 213, 0.1);
}

.bundle-item-row.picked .bundle-title {
    color: #4caf50;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Animations */
.item-card.fade-in {
    animation: fadeIn .5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   Small Mobile Layout (≤ 480px)
   ========================================================================== */
@media (max-width: 480px) {

    /* Modal */
    .modal-overlay {
        padding: 0.5rem;
    }

    .items-grid {
        padding: 0.0rem;
    }

    .modal-content {
        max-height: 90vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.8rem 1rem;
    }

    .sort-options,
    .filter-options {
        gap: 0.5rem;
    }

    .modal-section {
        margin-bottom: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .sort-option,
    .filter-option input {
        padding: 0.6rem 0.8rem;
    }

    .modal-footer button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        width: 100%;
    }

    /* Bundle Modal - Mobile Layout */
    .bundle-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 10px;
    }

    .bundle-modal-header {
        padding: 0.8rem 1rem;
    }

    .bundle-modal-header h3 {
        font-size: 1rem;
    }

    .bundle-modal-close {
        font-size: 1.5rem;
    }

    .bundle-modal-body {
        padding: 0.8rem;
    }

    .bundle-modal-body h4 {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }

    /* Convert table to card layout on mobile */
    .bundle-table {
        display: block;
        border-collapse: separate;
    }

    .bundle-table thead {
        display: none;
    }

    .bundle-table-container {
        border: none;
        margin-top: 0.5rem;
    }

    /* Card-based layout for mobile */
    .bundle-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .bundle-item-row {
        display: grid !important;
        grid-template-columns: 1fr 130px;
        grid-template-areas:
            "title action"
            "sku action"
            "location action"
            "quantity action";
        background-color: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 0.75rem;
        gap: 0.5rem 0.75rem;
        align-items: start;
    }

    .bundle-item-row.picked {
        background-color: #f1f8f4;
        border-color: #4caf50;
    }

    .bundle-item-row.queued {
        background-color: rgba(128, 90, 213, 0.1);
        border-color: #805AD5;
    }

    .bundle-item-row td {
        padding: 0;
        border: none;
    }

    /* Left column: Text info */
    .bundle-title {
        grid-area: title;
        font-size: 0.95rem;
        font-weight: 600;
        color: #333;
        line-height: 1.3;
    }

    .bundle-sku {
        grid-area: sku;
        font-size: 1rem;
        color: #666;
    }

    .bundle-sku::before {
        content: "SKU: ";
        font-weight: 600;
        color: #333;
    }

    .bundle-location {
        grid-area: location;
        font-size: 0.85rem;
        color: #0095ff;
        font-weight: 500;
    }

    .bundle-location::before {
        content: "Location: ";
        font-weight: 600;
        color: #333;
    }

    .bundle-quantity {
        grid-area: quantity;
        font-size: 0.85rem;
        color: #666;
    }

    .bundle-quantity::before {
        content: "Quantity: ";
        font-weight: 600;
        color: #333;
    }

    /* Right column: Image and button stacked */
    .bundle-pick-action {
        grid-area: action;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
        justify-content: flex-start;
    }

    .bundle-image-container {
        width: 100%;
        aspect-ratio: 1;
        background-color: #f8f9fa;
        border-radius: 6px;
        border: 1px solid #e0e0e0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .bundle-image-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .bundle-no-image {
        font-size: 0.7rem;
        color: #999;
        text-align: center;
        padding: 0.5rem;
    }

    .bundle-pick-btn {
        width: 100%;
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        min-width: unset;
    }

    /* Item Card */
    .item-card {
        padding: 0.5rem;
        border-radius: 0.5rem;
        gap: 0.5rem;
        min-width: 0;
        max-width: 100%;
    }

    .item-content {
        gap: 0.0rem;
        grid-template-columns: 60px minmax(0, 1fr) 80px;
        min-width: 0;
    }

    .item-image {
        width: 60px;
        height: 60px;
    }

    .item-quantity {
        font-size: 2.5rem;
        min-width: 0;
    }

    .item-location {
        padding-top: 0.1rem;
        padding-bottom: 0.1rem;
    }

    .item-title {
        font-size: 0.9rem;
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }

    .order-info {
        width: 100%;
        font-size: 0.7rem;
        padding-top: 0.15rem;
        margin-top: 0.2rem;
        gap: 0.15rem 0.5rem;
        min-width: 0;
    }

    .item-more-actions {
        max-width: 8rem;
    }

    .item-more-button {
        min-width: 0;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    .status-wrapper {
        max-width: 100%;
    }

    .order-number,
    .stock-values {
        font-size: 0.875rem;
    }

    .status-text {
        font-size: 0.7rem;
    }

    .stock-values {
        white-space: normal;
        line-height: 1.25;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.05rem;
    }

    .stock-values .stock-sep {
        display: none;
    }

    .stock-values .stock-primary,
    .stock-values .stock-secondary {
        white-space: nowrap;
    }

    .dual-status {
        flex-direction: column;
        gap: 1px;
        align-items: flex-end;
    }

    .pick-button {
        width: 80px;
        min-width: 80px;
        padding: 0.75rem;
        font-size: 0.9rem;
        letter-spacing: 0;
    }

    .item-actions {
        grid-column: 3;
        justify-self: end;
        width: 80px;
        min-width: 0;
    }

    /* Pick Controls */
    .pick-controls {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.1rem;
        align-items: stretch;
    }

    .pick-location-control {
        width: 100%;
    }

    .pick-location-select {
        flex: 1;
        max-width: none;
    }

    /* Connection state display */
    .pick-controls .primary-button {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Split button container needs special handling in small mobile */
    .pick-controls .split-button-container {
        width: 100%;
        display: flex;
    }

    /* Show/Hide Picked Items + Auto-load toggles */
    .pick-controls #togglePickedBtn,
    .pick-controls #toggleAutoLoadBtn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .last-sync {
        text-align: center;
        margin: 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
        width: 100%;
        min-width: 100%;
    }

    .last-sync-time {
        min-width: 100%;
        text-align: center;
        margin-bottom: 2px;
    }

    /* Count Display */
    .count-display {
        width: 100%;
        text-align: center;
        padding: 0.1rem 0;
        margin-top: 0.1rem;
        min-width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }

    .count-display .item-count::after {
        content: '|';
        margin-left: 1rem;
        color: #ddd;
    }

    .count-display .order-count {
        margin-left: 0;
    }

    /* Kebab Menu */
    .kebab-menu {
        top: 0.4rem;
        left: 4px;
    }

}

/* ==========================================================================
   Mobile Layout (481px - 768px)
   ========================================================================== */
@media (min-width: 481px) and (max-width: 768px) {

    /* Modal */
    .modal-content {
        max-width: 100%;
        max-height: 80vh;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .sort-option,
    .filter-option input {
        padding: 0.6rem 0.8rem;
    }

    .modal-footer button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    /* Bundle Modal - Mobile Layout (481-768px) */
    .bundle-modal-content {
        max-width: 100%;
        max-height: 85vh;
    }

    .bundle-modal-body {
        padding: 1rem;
    }

    /* Convert table to card layout on mobile */
    .bundle-table {
        display: block;
        border-collapse: separate;
    }

    .bundle-table thead {
        display: none;
    }

    .bundle-table-container {
        border: none;
        margin-top: 0.75rem;
    }

    /* Card-based layout for mobile */
    .bundle-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
    }

    .bundle-item-row {
        display: grid !important;
        grid-template-columns: 1fr 150px;
        grid-template-areas:
            "title action"
            "sku action"
            "location action"
            "quantity action";
        background-color: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 0.85rem;
        gap: 0.6rem 0.85rem;
        align-items: start;
    }

    .bundle-item-row.picked {
        background-color: #f1f8f4;
        border-color: #4caf50;
    }

    .bundle-item-row.queued {
        background-color: rgba(128, 90, 213, 0.1);
        border-color: #805AD5;
    }

    .bundle-item-row td {
        padding: 0;
        border: none;
    }

    /* Left column: Text info */
    .bundle-title {
        grid-area: title;
        font-size: 1rem;
        font-weight: 600;
        color: #333;
        line-height: 1.3;
    }

    .bundle-sku {
        grid-area: sku;
        font-size: 1.05rem;
        color: #666;
    }

    .bundle-sku::before {
        content: "SKU: ";
        font-weight: 600;
        color: #333;
    }

    .bundle-location {
        grid-area: location;
        font-size: 0.9rem;
        color: #0095ff;
        font-weight: 500;
    }

    .bundle-location::before {
        content: "Location: ";
        font-weight: 600;
        color: #333;
    }

    .bundle-quantity {
        grid-area: quantity;
        font-size: 0.9rem;
        color: #666;
    }

    .bundle-quantity::before {
        content: "Quantity: ";
        font-weight: 600;
        color: #333;
    }

    /* Right column: Image and button stacked */
    .bundle-pick-action {
        grid-area: action;
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        align-items: stretch;
        justify-content: flex-start;
    }

    .bundle-image-container {
        width: 100%;
        aspect-ratio: 1;
        background-color: #f8f9fa;
        border-radius: 6px;
        border: 1px solid #e0e0e0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .bundle-image-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .bundle-no-image {
        font-size: 0.75rem;
        color: #999;
        text-align: center;
        padding: 0.5rem;
    }

    .bundle-pick-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        min-width: unset;
    }

    /* Item Card */
    .items-grid {
        padding: 0.5rem;
    }

    .item-card {
        padding: 0.75rem;
        border-radius: 8px;
        gap: 0.75rem;
        min-width: 0;
        max-width: 100%;
    }

    .item-content {
        gap: 0.5rem;
        grid-template-columns: 80px minmax(0, 1fr) 90px;
        min-width: 0;
    }

    .item-image {
        width: 80px;
        height: 80px;
    }

    .item-quantity {
        font-size: 2.5rem;
        min-width: 0;
    }

    .pick-button {
        width: 90px;
        min-width: 90px;
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
        letter-spacing: 0;
    }

    .item-actions {
        grid-column: 3;
        justify-self: end;
        width: 90px;
        min-width: 0;
    }

    .order-info {
        gap: 0.25rem 0.5rem;
        min-width: 0;
        font-size: 0.75rem;
    }

    .order-number,
    .stock-values {
        font-size: 0.938rem;
    }

    .status-text {
        font-size: 0.75rem;
    }

    .stock-values {
        white-space: normal;
        line-height: 1.25;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.1rem;
    }

    .stock-values .stock-sep {
        display: none;
    }

    .stock-values .stock-primary,
    .stock-values .stock-secondary {
        white-space: nowrap;
    }

    .item-more-actions {
        max-width: 9rem;
    }

    .item-more-button {
        min-width: 0;
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .dual-status {
        flex-direction: column;
        gap: 2px;
        align-items: flex-end;
    }

    .status-wrapper {
        max-width: 100%;
    }

    /* Pick Controls */
    .pick-controls {
        flex-direction: column;
        padding: 1rem;
        gap: 10px;
        align-items: stretch;
    }

    /* Connection state display */
    .pick-controls .primary-button {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    /* Split button container needs special handling in mobile view */
    .pick-controls .split-button-container {
        width: 100%;
        display: flex;
    }

    /* Show/Hide Picked Items + Auto-load toggles */
    .pick-controls #togglePickedBtn,
    .pick-controls #toggleAutoLoadBtn {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    .last-sync {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
        min-width: 100%;
    }

    .last-sync-time {
        min-width: 100%;
        text-align: center;
    }

    /* Count Display */
    .count-display {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        min-width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }

    .count-display .item-count::after {
        content: '|';
        margin-left: 1rem;
        color: #ddd;
    }

    .count-display .order-count {
        margin-left: 0;
    }

    /* Kebab Menu */
    .kebab-menu {
        top: 8px;
        left: 8px;
    }

}

/* ==========================================================================
   Tablet Layout (768px - 1024px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {

    /* Bundle Modal - Tablet Layout */
    .bundle-modal-content {
        max-width: 90%;
    }

    .bundle-table {
        font-size: 0.85rem;
    }

    .bundle-table th,
    .bundle-table td {
        padding: 0.6rem;
    }

    .bundle-pick-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        min-width: 70px;
    }

    /* Item Card */
    .item-card {
        padding: 1rem;
        border-radius: 10px;
        gap: 1rem;
    }

    .item-content {
        gap: 1.5rem;
    }

    .item-image {
        width: 100px;
        height: 100px;
    }

    .item-quantity {
        font-size: 3.5rem;
    }

    .pick-button {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }

    .item-actions {
        grid-column: 3;
        justify-self: end;
        width: auto;
    }

    /* Pick Controls */
    .pick-controls {
        flex-direction: column;
        padding: 1rem;
        gap: 12px;
        align-items: stretch;
    }

    /* Connection state display */
    .pick-controls .primary-button {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    /* Split button container needs special handling in tablet view */
    .pick-controls .split-button-container {
        width: 100%;
        display: flex;
    }

    /* Show/Hide Picked Items + Auto-load toggles */
    .pick-controls #togglePickedBtn,
    .pick-controls #toggleAutoLoadBtn {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    .last-sync {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
        min-width: 100%;
    }

    .last-sync-time {
        min-width: 100%;
        text-align: center;
    }

    /* Count Display */
    .count-display {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        min-width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }

    .count-display .item-count::after {
        content: '|';
        margin-left: 1rem;
        color: #ddd;
    }

    .count-display .order-count {
        margin-left: 0;
    }

    /* Kebab Menu */
    .kebab-menu {
        top: 12px;
        left: 8px;
    }

}

/* ==========================================================================
   Desktop Layout (> 1024px)
   ========================================================================== */
@media (min-width: 1025px) {

    /* Item Card */
    .item-card {
        max-width: 1200px;
        margin: 0 auto 1rem auto;
        padding: 2rem;
        gap: 1.5rem;
    }

    .item-title {
        font-size: 1.5rem;
        padding-bottom: 1rem;
    }

    .item-content {
        gap: 3rem;
    }

    .item-image {
        width: 150px;
        height: 150px;
    }

    .item-quantity {
        font-size: 4rem;
    }

    .item-identifiers {
        padding: 1rem 0 0.35rem 0;
    }

    .item-sku {
        font-size: 1.65rem;
    }

    .item-barcode {
        font-size: 0.95rem;
    }

    .item-location {
        font-size: 1.4rem;
        padding: 1rem 0;
    }

    .order-info {
        padding-top: 1rem;
        font-size: 1.1rem;
    }

    .order-number {
        font-size: 1.375rem;
    }

    .stock-values {
        font-size: 1.125rem;
    }

    .pick-button {
        padding: 1rem 2rem;
        min-width: 140px;
        font-size: 1.1rem;
    }

    /* Pick Controls - max-width via shared .ops-page-content */
    .pick-controls {
        margin: 0 auto 1rem auto;
        padding: 1.5rem;
        justify-content: flex-start;
        gap: 15px;
    }

    .pick-controls button {
        min-width: 180px;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    /* Split button container in desktop view */
    .pick-controls .split-button-container {
        flex: 0 0 auto;
        min-width: 280px;
        max-width: 350px;
    }

    /* Reset button in desktop view */
    .pick-controls .split-button-container .split-right {
        flex: 1;
    }

    .last-sync {
        font-size: 1rem;
        width: 100%;
        text-align: center;
        margin: 0.35rem 0 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color, #e5e5e7);
        margin-left: 0;
        min-width: 0;
    }

    .last-sync-time {
        min-width: 0;
        text-align: center;
    }

    /* Count Display */
    .count-display {
        font-size: 1rem;
        width: 100%;
        margin: 0;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        padding: 0.5rem 0;
    }

    .count-display .item-count::after {
        content: '|';
        margin-left: 1rem;
        color: #ddd;
    }

    .count-display .order-count {
        margin-left: 0;
    }

    /* Items Grid - max-width via shared .ops-page-content */
    .items-grid {
        margin: 0 auto;
    }
}

/* ==========================================================================
   Undo Button Styles
   ========================================================================== */
.undo-button-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.undo-button-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.undo-button-container.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.undo-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #0095ff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.undo-button:hover {
    background-color: #0077cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.undo-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.undo-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Toast notification for undo */
.toast-notification {
    position: fixed;
    bottom: 70px;
    left: 20px;
    background-color: #333;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-notification.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments for the undo button */
@media (max-width: 480px) {
    .undo-button {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .undo-button-container {
        bottom: 0.5rem;
        left: 15px;
    }

    .toast-notification {
        bottom: 60px;
        left: 15px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* ==========================================================================
   Pick History Modal
   ========================================================================== */
.pick-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.75rem 1rem 1.5rem;
    padding-top: max(2.75rem, calc(env(safe-area-inset-top, 0px) + 1.75rem));
    box-sizing: border-box;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pick-history-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pick-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pick-history-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.pick-history-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pick-history-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.pick-history-subtitle {
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pick-history-loading,
.pick-history-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

.pick-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.history-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem 1rem;
}

.history-page-btn {
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
    color: #333;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.history-page-btn:hover {
    background: #eaeaea;
    border-color: #bdbdbd;
}

.history-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.history-page-info {
    color: #666;
    font-size: 0.85rem;
}

.pick-history-modal .history-page-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

.pick-history-modal .history-page-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.pick-history-modal .history-page-info {
    color: rgba(255, 255, 255, 0.6);
}

/* Custom scrollbar for history list */
.pick-history-list::-webkit-scrollbar {
    width: 8px;
}

.pick-history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.pick-history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.pick-history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Pick History Entry */
.pick-history-entry {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    margin: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.pick-history-entry:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.pick-history-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.pick-history-image-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
}

.pick-history-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.pick-history-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pick-history-product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action badges */
.pick-history-action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.pick-badge {
    background: rgba(76, 175, 80, 0.25);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.unpick-badge {
    background: rgba(244, 67, 54, 0.25);
    color: #ef9a9a;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.undo-badge {
    background: rgba(255, 152, 0, 0.25);
    color: #ffcc80;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

.pick-history-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.pick-history-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pick-history-order {
    color: #4fc3f7;
}

.pick-history-sku {
    color: rgba(255, 255, 255, 0.4);
}

.pick-history-location {
    color: #81c784;
    font-weight: 600;
}

.pick-history-picker {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    font-style: italic;
    margin-top: 0.15rem;
}

.pick-history-time-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    min-width: 80px;
}

.pick-history-time {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.pick-history-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.pick-history-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}


/* ============================================
   Location Change History Modal Styles
   (for View Change History in More menu)
   ============================================ */

.location-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.location-history-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.75rem 1rem 1.5rem;
    padding-top: max(2.75rem, calc(env(safe-area-inset-top, 0px) + 1.75rem));
    box-sizing: border-box;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

.location-history-modal .modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0.5rem 0 0;
    box-sizing: border-box;
    animation: slideUp 0.3s ease;
}

.location-history-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.location-history-modal .modal-header h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.location-history-modal .close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.location-history-modal .close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.location-history-modal .modal-body {
    padding: 1rem 1.5rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.location-history-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.location-history-modal .modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.location-history-modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.location-history-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.location-history-modal .product-info {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.location-history-modal .product-info h4 {
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
}

.location-history-modal .product-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.location-history-modal .meta-item {
    color: rgba(255, 255, 255, 0.5);
}

.location-history-modal .history-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.location-history-modal .no-history {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 2rem 1rem;
}

.location-history-modal .history-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.location-history-modal .history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.location-history-modal .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.location-history-modal .history-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.location-history-modal .history-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    text-align: right;
}

.location-history-modal .history-image {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.location-history-modal .history-image-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.location-history-modal .action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.location-history-modal .action-badge.create {
    background: rgba(76, 175, 80, 0.25);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.location-history-modal .action-badge.update {
    background: rgba(33, 150, 243, 0.25);
    color: #90caf9;
    border: 1px solid rgba(33, 150, 243, 0.4);
}

.location-history-modal .action-badge.delete {
    background: rgba(244, 67, 54, 0.25);
    color: #ef9a9a;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.location-history-modal .timestamp {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.location-history-modal .user {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.location-history-modal .changes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.location-history-modal .change-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.location-history-modal .field-name {
    font-weight: 600;
    color: #fff;
    min-width: 50px;
}

.location-history-modal .old-value {
    color: #ef9a9a;
    min-width: 0;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.location-history-modal .arrow {
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
    flex-shrink: 0;
}

.location-history-modal .new-value {
    color: #81c784;
    font-weight: 600;
    min-width: 0;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.location-history-modal .value-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    margin-right: 0.25rem;
}

/* Location History Modal - Responsive */
@media (max-width: 768px) {
    .location-history-modal .modal-overlay {
        padding: 2.75rem 0.75rem 1.5rem;
        padding-top: max(2.75rem, calc(env(safe-area-inset-top, 0px) + 1.75rem));
    }

    .location-history-modal .modal-content {
        max-width: calc(100% - 1.5rem);
        max-height: 90vh;
        margin: 0.5rem 0 0;
    }

    .location-history-modal .modal-header,
    .location-history-modal .modal-body {
        padding: 1rem;
    }

    .location-history-modal .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .location-history-modal .product-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .location-history-modal .modal-overlay {
        padding: 2.75rem 0.5rem 1.5rem;
        padding-top: max(2.75rem, calc(env(safe-area-inset-top, 0px) + 1.75rem));
    }

    .location-history-modal .modal-content {
        max-width: calc(100% - 1rem);
    }

    .location-history-modal .modal-header,
    .location-history-modal .modal-body {
        padding: 0.75rem;
    }

    .location-history-modal .change-item {
        flex-wrap: wrap;
        gap: 0.35rem;
        font-size: 0.85rem;
    }

    .location-history-modal .history-item {
        padding: 0.75rem;
    }

    .location-history-modal .field-name {
        min-width: 45px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .location-history-modal .old-value,
    .location-history-modal .new-value {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .pick-history-modal {
        padding: 2.75rem 0.5rem 1.5rem;
        padding-top: max(2.75rem, calc(env(safe-area-inset-top, 0px) + 1.75rem));
    }

    .pick-history-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 10px;
    }

    .pick-history-entry {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .pick-history-image,
    .pick-history-image-placeholder {
        display: none;
    }

    .pick-history-time-col {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .pick-history-header h2 {
        font-size: 1.2rem;
    }
}

/* Tablet Responsive */
@media (min-width: 601px) and (max-width: 1024px) {
    .pick-history-modal-content {
        max-width: 90%;
    }
}