/**
* 2007-2022 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2022 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*
* Don't forget to prefix your containers with your own identifier
* to avoid any conflicts with others containers.
*/

/* button hook */
a.btn.btn-quick-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#myGrid .btn.add-to-cart {
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 50%;
    color: white;
    border: none;
    min-width: auto;
}
#myGrid .btn.add-to-cart svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Toolbar between filters and grid */
.quickorder-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0;
    margin-bottom: 0.25rem;
}
.quickorder-toolbar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.quickorder-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
#qog-quickorder-wrap .qog-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--qog-font-size, 0.8125rem);
    padding: var(--qog-button-padding, 0.35rem) var(--qog-button-padding, 0.75rem);
    border-radius: var(--qog-border-radius, 4px);
    border-color: var(--qog-border-color, #dee2e6);
    color: var(--qog-text-color, inherit);
    white-space: nowrap;
    line-height: 1.4;
}
#qog-quickorder-wrap .qog-toolbar-btn svg {
    flex-shrink: 0;
}
#qog-quickorder-wrap .qog-toolbar-icon {
    padding: 0.35rem 0.5rem;
}
#qog-quickorder-wrap .qog-toolbar-btn:hover:not(:disabled) {
    background-color: #f8f9fa;
    color: var(--qog-text-color, inherit);
    border-color: #bbc0c7;
}
#qog-quickorder-wrap .qog-toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* Dropdown (no Bootstrap dependency) */
.qog-dropdown {
    position: relative;
}
.qog-dropdown-toggle .qog-chevron {
    margin-left: 0.1rem;
}
.qog-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 10rem;
    margin-top: 0.25rem;
    padding: 0.25rem 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.qog-dropdown.open .qog-dropdown-menu {
    display: block;
}
.qog-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.75rem;
    border: none;
    background: none;
    font-size: 0.8125rem;
    color: #333;
    cursor: pointer;
    text-align: left;
}
.qog-dropdown-item:hover {
    background-color: #f5f5f5;
}
.qog-dropdown-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.qog-dropdown-menu--right {
    left: auto;
    right: 0;
}
.qog-dropdown-columns {
    max-height: 70vh;
    overflow-y: auto;
}
.qog-dropdown-header {
    display: block;
    padding: 0.3rem 0.75rem 0.15rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.qog-dropdown-divider {
    height: 1px;
    margin: 0.25rem 0;
    background-color: #e5e5e5;
}

/* Cart badge - visible only in fullscreen */
#qog-quickorder-wrap .qog-cart-badge {
    display: none !important;
    text-decoration: none;
}
#qog-quickorder-wrap.qog-fullscreen .qog-cart-badge {
    display: inline-flex !important;
}
.qog-cart-count {
    font-weight: 600;
    font-size: 0.8125rem;
    min-width: 1.25rem;
    text-align: center;
}

/* Fullscreen mode */
#qog-quickorder-wrap.qog-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#qog-quickorder-wrap.qog-fullscreen .quickorder-grid-container {
    flex: 1;
    height: auto !important;
    min-height: 0;
}
#qog-quickorder-wrap.qog-fullscreen #myGrid {
    min-height: 0;
}
#qog-quickorder-wrap.qog-fullscreen .grid-header {
    margin-bottom: 0.5rem;
}
#qog-quickorder-wrap.qog-fullscreen .quickorder-toolbar {
    margin-bottom: 0.15rem;
}

/* Flexbox container for full height grid - height set dynamically by JS */
.quickorder-grid-container {
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

/* AG Grid takes remaining space */
#myGrid {
    flex: 1;
    width: 100%;
    min-height: 400px;
}

/* Sticky footer for button + totals */
.quickorder-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 10;
    border-top: 1px solid #e0e0e0;
}

.quickorder-footer-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.qog-reset-btn {
    font-size: 0.8125rem;
    padding: 0.35rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.quickorder-totals {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.quickorder-total-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.quickorder-total-label {
    font-size: 0.875rem;
    color: #666;
}

.quickorder-total-value {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
}

button#bulk_fancy_add_to_cart {
    margin: 0;
}

@media screen and (max-width: 576px) {
    .quickorder-footer {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .qog-reset-btn {
        order: 2;
    }
    .quickorder-footer-right {
        width: 100%;
        justify-content: flex-end;
        order: 1;
    }
}

.quickorder-searchwrap input,
select#category_selector
{
    border: 1px solid #bbc0c7;
    border-radius: 4px;
    transition: border-color 0.15s ease;
}

@media screen and (max-width: 480px) {
    #grid-wrapper {
        margin: 0 -15px;
    }
}


/* filters header in table page */
.grid-header {
    margin-bottom: 1em;
}
.grid-header .form-control {
    line-height: 2em;
    background: white;
}
.grid-header select.form-control:not([size]):not([multiple]) {
    height: auto;
}
.grid-header select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.1rem center;
    background-size: 1em;
    color: #7a828a;
}
#qog-quickorder-wrap .grid-header .form-control:focus-visible,
#qog-quickorder-wrap .grid-header .form-control:focus {
    outline: none;
    border-color: #333;
    box-shadow: none;
}
.quickorder-searchwrap,
.quickorder-categorywrap {
    position: relative;
    margin-bottom: 1em;
}
.quickorder-searchwrap svg {
    width: 20px;
    position: absolute;
    right: 2.25em;
    top: 0.9em;
    fill: #7a828a;
}
.quickorder-searchwrap input {
    font-size: 1em;
}
.quickorder-searchwrap input::placeholder {
    color: #7a828a;
}

/* custom styles for table */
.ag-cell-centered {
    display: flex !important;
    align-items: center;
    height: 100% !important;
}
/* Image cell - prevent overflow ellipsis and fit image to row */
#myGrid .ag-cell img {
    object-fit: contain;
    max-height: 100%;
}
#myGrid .ag-cell .ag-cell-wrapper {
    overflow: visible;
}
/* Qty column - editable indicator */
#myGrid .ag-cell.qog-cell-qty {
    background-color: rgba(13, 110, 253, 0.06);
}
#myGrid .ag-header-cell.qog-header-qty {
    background-color: rgba(13, 110, 253, 0.08);
}
/* Sum columns - calculated value indicator */
#myGrid .ag-cell.qog-cell-sum {
    background-color: rgba(25, 135, 84, 0.06);
}
#myGrid .ag-header-cell.qog-header-sum {
    background-color: rgba(25, 135, 84, 0.08);
}

#myGrid input[type="number"] {  
   -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
}
#input {
    max-width: 100%;
    padding: 0 1em;
}

/* TreeselectJS Integration - Match search input styling exactly */
#qog-treeselect-container {
    width: 100%;
}

/* Match PrestaShop form control styling */
#qog-treeselect-container .treeselect-input {
    border: 1px solid #bbc0c7;
    border-radius: 4px;
    font-size: 1em;
    min-height: 50px;
    max-height: 50px;
    height: 50px;
    padding: 0 40px 0 1rem;
    background-color: white;
    line-height: 1.5;
    display: flex;
    align-items: center;
    transition: border-color 0.15s ease;
}

#qog-treeselect-container .treeselect-input:hover,
#qog-treeselect-container .treeselect-input--focused {
    border-color: #333;
}

/* Treeselect icon colors — match search icon */
#qog-treeselect-container .treeselect-input__clear,
#qog-treeselect-container .treeselect-input__arrow {
    color: #7a828a;
}

/* Input field inside treeselect */
#qog-treeselect-container .treeselect-input__edit {
    font-size: 1em;
    line-height: 1.5;
    padding: 0;
}

/* Placeholder styling */
#qog-treeselect-container .treeselect-input__edit::placeholder {
    color: #7a828a;
}

/* Tag styling to match PrestaShop */
#qog-treeselect-container .treeselect__tags {
    min-height: calc(2.5em + 2px);
    padding: 0.25rem 0.5rem;
}

#qog-treeselect-container .treeselect__tag {
    background-color: #007bff;
    color: white;
    border-radius: 3px;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    font-size: 0.875rem;
}

#qog-treeselect-container .treeselect__tag-remove {
    color: white;
    opacity: 0.7;
}

#qog-treeselect-container .treeselect__tag-remove:hover {
    opacity: 1;
}

/* Dropdown list styling */
#qog-treeselect-container .treeselect-list {
    max-height: 350px;
    border-color: #bbc0c7;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Search input in dropdown */
#qog-treeselect-container .treeselect-list__search-input {
    border-bottom-color: #e0e0e0;
    padding: 0.5rem;
}

/* List items */
#qog-treeselect-container .treeselect-list__item {
    padding: 0.5rem 1rem;
    transition: background-color 0.15s ease;
}

#qog-treeselect-container .treeselect-list__item:hover {
    background-color: #f8f9fa;
}

#qog-treeselect-container .treeselect-list__item--selected {
    background-color: #e7f3ff;
}

#qog-treeselect-container .treeselect-list__item--focused {
    background-color: #f0f2f4 !important;
}

/* Checkbox styling */
#qog-treeselect-container .treeselect-list__item-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
}

/* Expand/collapse icons */
#qog-treeselect-container .treeselect-list__item-icon {
    color: #7a828a;
}

/* Empty state */
#qog-treeselect-container .treeselect-list__empty {
    padding: 1rem;
    color: #7a828a;
    text-align: center;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    #qog-treeselect-container .treeselect-list {
        max-height: 300px;
    }

    #qog-treeselect-container .treeselect__tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Loading state */
#qog-treeselect-container .treeselect--loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Ensure proper z-index */
#qog-treeselect-container .treeselect-list {
    z-index: 1000;
}

/* Disabled state */
#qog-treeselect-container .treeselect--disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Image magnify preview on hover */
.qog-magnify {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 4px;
    display: none;
}
.qog-magnify img {
    display: block;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

/* Image modal (theme-agnostic, no Bootstrap dependency) */
.qog-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qog-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.qog-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}
.qog-modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.qog-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    color: #666;
}
.qog-modal-close:hover {
    color: #000;
}
.qog-modal-body {
    padding: 1rem;
    text-align: center;
}
.qog-modal-body img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
}

/* Discount price display — stacked: new price on top, old price below */
.qog-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
    padding: 2px 0;
}
.qog-price-line {
    white-space: nowrap;
}
.qog-price-new {
    color: #e74c3c;
    font-weight: 600;
}
.qog-price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 0.8em;
}

/* Product name cell with badges — above title */
.qog-name-cell {
    width: 100%;
}
.qog-name-badges {
    display: flex;
    gap: 3px;
    margin-bottom: 1px;
    line-height: 1;
}
.qog-name-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 0 4px;
    border-radius: 2px;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.qog-badge-new {
    background: #27ae60;
    color: #fff;
}
.qog-badge-onsale {
    background: var(--qog-sale-badge-bg, #e74c3c);
    color: var(--qog-sale-badge-text, #fff);
}
.qog-badge-bestseller {
    background: #f39c12;
    color: #fff;
}

/* Predefined filter pills */
.qog-predefined-filters {
    display: flex;
    gap: 5px;
    margin-bottom: 6px;
}
.qog-filter-pill {
    background: #f0f1f3;
    border: 1px solid var(--qog-border-color, #d5d8dc);
    border-radius: var(--qog-border-radius, 20px);
    padding: var(--qog-button-padding, 3px) 12px;
    font-size: var(--qog-font-size, 0.75rem);
    font-weight: 500;
    color: var(--qog-text-color, #555);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
}
.qog-filter-pill:hover {
    background: var(--qog-button-hover-bg, #e4e6ea);
    border-color: var(--qog-border-color, #bfc3c9);
}
.qog-filter-pill.active {
    background: var(--qog-filter-active-bg, var(--qog-primary, #4472C4));
    border-color: var(--qog-filter-active-bg, var(--qog-primary, #4472C4));
    color: #fff;
}

/* Clear filters icon */
.qog-clear-filters {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #7a828a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-left: 4px;
}
.qog-clear-filters:hover {
    background: #f0f1f3;
    color: #d32f2f;
}
.qog-clear-filters svg {
    display: block;
}

/* Import CSV modal — full-width, unified table */
.qog-import-modal-content {
    background: white;
    border-radius: 8px;
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.qog-import-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}
.qog-import-header .qog-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}
.qog-import-header .qog-modal-close {
    margin-left: auto;
}
.qog-import-settings {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.qog-import-settings label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
}
.qog-import-settings select {
    padding: 0.2rem 0.4rem;
    border: 1px solid #bbc0c7;
    border-radius: 3px;
    font-size: 0.8125rem;
}
/* Scrollable table area */
.qog-import-table-wrap {
    flex: 1;
    overflow: auto;
    min-height: 0;
}
#qog-import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
/* Column labels row */
#qog-import-table thead .qog-import-label-row th {
    padding: 0.5rem 0.6rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    background: #edf0f5;
    white-space: nowrap;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
}
/* Mapping selects row */
#qog-import-table thead .qog-import-select-row th {
    padding: 0.25rem 0.6rem 0.5rem;
    background: #edf0f5;
    position: sticky;
    top: 1.55rem;
    z-index: 2;
}
.qog-import-map-select {
    width: 100%;
    padding: 0.3rem 0.4rem;
    border: 1px solid #bbc0c7;
    border-radius: 3px;
    font-size: 0.8125rem;
    background: white;
}
/* Preview data rows */
#qog-import-table tbody td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}
#qog-import-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}
#qog-import-table tbody tr:hover {
    background: #e9ecef;
}
/* Footer */
.qog-import-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}
.qog-import-footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.qog-import-row-count {
    font-size: 0.8125rem;
    color: #888;
}
.qog-import-validation {
    font-size: 0.8125rem;
    color: #dc3545;
}
.qog-import-actions {
    display: flex;
    gap: 0.5rem;
}
.qog-import-actions button {
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    cursor: pointer;
}
.qog-import-actions .qog-import-close {
    background: white;
    border: 1px solid #bbc0c7;
    color: #333;
}
.qog-import-actions .qog-import-close:hover {
    background: #f0f0f0;
}
#qog-import-confirm {
    background: #4472C4;
    border: 1px solid #4472C4;
    color: white;
}
#qog-import-confirm:hover {
    background: #3a62a8;
}
#qog-import-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
@media screen and (max-width: 600px) {
    .qog-import-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .qog-import-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Toastr overrides - prevent Bootstrap 5 .toast class from breaking toastr styles */
#toast-container > .toast {
    background-color: #030303;
    opacity: 1 !important;
}
#toast-container > .toast-success {
    background-color: #51A351;
}
#toast-container > .toast-error {
    background-color: #BD362F;
}
#toast-container > .toast-info {
    background-color: #2F96B4;
}
#toast-container > .toast-warning {
    background-color: #F89406;
}

/* ── Saved Order Templates ─────────────────────────────────────────── */

/* Save order modal */
.qog-save-order-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.qog-save-order-modal-content .qog-modal-body {
    padding: 1rem 1.25rem;
}
.qog-save-order-modal-content .qog-modal-body label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #333;
}
.qog-save-order-modal-content .qog-modal-body input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #bbc0c7;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.qog-save-order-modal-content .qog-modal-body input[type="text"]:focus {
    outline: none;
    border-color: #4472C4;
}
.qog-save-order-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e0e0e0;
}

/* Saved orders list modal */
.qog-saved-orders-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.qog-saved-orders-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0.5rem 0;
}
.qog-saved-orders-loading,
.qog-saved-orders-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #888;
    font-size: 0.875rem;
}
.qog-saved-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}
.qog-saved-order-item:last-child {
    border-bottom: none;
}
.qog-saved-order-item:hover {
    background-color: #f8f9fa;
}
.qog-saved-order-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}
.qog-saved-order-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qog-saved-order-meta {
    font-size: 0.75rem;
    color: #888;
}
.qog-saved-order-badge-local {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #7c6f1b;
    background: #fef3c7;
    padding: 1px 6px;
    border-radius: 9px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.qog-saved-order-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-left: 0.75rem;
}
.qog-saved-order-actions .btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.qog-saved-order-actions .btn svg {
    flex-shrink: 0;
}

/* ── Barcode Scanner ─────────────────────────────────── */

/* Hardware scanner badge (green pulsing dot) */
.qog-hw-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    margin-left: 4px;
    animation: qog-pulse 1.5s infinite;
}
@keyframes qog-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Hardware scanner status text in dropdown */
.qog-hw-status {
    font-size: 0.7rem;
    color: #22c55e;
    margin-left: auto;
    padding-left: 0.5rem;
}

/* Scanner modal — dark theme */
.qog-scanner-modal-content {
    background: #111;
    color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 540px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.qog-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #333;
}
.qog-scanner-header .qog-modal-title {
    color: #fff;
    font-size: 1rem;
    margin: 0;
}
.qog-scanner-header .qog-modal-close {
    color: #999;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.qog-scanner-header .qog-modal-close:hover {
    color: #fff;
}

/* Camera viewport */
.qog-scanner-viewport-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    overflow: hidden;
}
#qog-scanner-viewport {
    width: 100%;
    height: 100%;
}
#qog-scanner-viewport video,
#qog-scanner-viewport canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Scan target overlay — centered rectangle */
.qog-scanner-target {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 30%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

/* Scanner footer */
.qog-scanner-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-top: 1px solid #333;
    font-size: 0.8rem;
    min-height: 38px;
}
.qog-scanner-status {
    color: #aaa;
}
.qog-scanner-last {
    color: #22c55e;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Row flash — pulsing green for ~3s (barcode scan, import, paste) */
.ag-row.qog-row-flash {
    animation: qog-row-flash 0.8s ease-in-out 3;
}
@keyframes qog-row-flash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(34, 197, 94, 0.3); }
}

/* Mobile responsive */
@media (max-width: 576px) {
    .qog-scanner-modal-content {
        width: 98%;
        border-radius: 8px;
    }
}
