/* Admin Edit Customer */
.select2-container .select2-selection--multiple,
.wp-admin .fulfillment-header .custom-control .select2-container .select2-selection--multiple {
    max-height: 50px;
    overflow: auto;
}

/* ============================================================================
 * Customer edit screen: product/address selects
 *
 * These controls (#edit_customer .customer-product-select and the address
 * selects driven by Address::get_address_select()) previously rendered with
 * no styling of their own -- Select2's box/dropdown chrome was untouched
 * default CSS.
 *
 * Scoped to #edit_customer (the whole customer-edit screen, all tabs) rather
 * than every select2 in wp-admin, so this doesn't reach into other admin
 * screens that use the same library.
 *
 * Colors are pulled from WordPress's own admin color scheme custom properties
 * (--wp-admin-theme-color and friends, set by core per user-selected scheme --
 * Default/Fresh, Light, Blue, Coffee, Ectoplasm, Midnight, Ocean, Sunrise) so
 * this follows whichever scheme the logged-in user has chosen rather than a
 * fixed color. The #0085ba fallback matches core's own Fresh/default scheme.
 * ============================================================================ */

/* ---- Select2 / selectWoo: product + address dropdowns -------------------- */

#edit_customer .select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    transition: border-color .1s ease-in-out, box-shadow .1s ease-in-out;
}
#edit_customer .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
    padding-right: 32px;
    color: #1d2327;
}
#edit_customer .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #757575;
}
#edit_customer .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    width: 30px;
    right: 4px;
}
#edit_customer .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #646970 transparent transparent transparent;
}
/* Focus ring matches core's own focused-input treatment */
#edit_customer .select2-container--default.select2-container--focus .select2-selection--single,
#edit_customer .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--wp-admin-theme-color, #0085ba);
    box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #0085ba);
    outline: 2px solid transparent;
}
#edit_customer .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #646970 transparent;
}

/* Product search while an add is in flight (setAddingProduct() in edit-customer.js):
   "Adding <product>", a spinner in place of the arrow, and a sweeping bar on the bottom edge */
#edit_customer .product-control.is-adding .select2-selection--single {
    position: relative;
    overflow: hidden;
    background-color: #f6f7f7;
    cursor: progress;
}
#edit_customer .product-control.is-adding .select2-selection--single .select2-selection__rendered {
    color: #50575e;
}
#edit_customer .product-control.is-adding .select2-selection--single .select2-selection__rendered::before {
    content: "Adding ";
    font-weight: 600;
    color: #1d2327;
}
/* WooCommerce's select2.css draws the chevron as a background SVG on the arrow itself */
#edit_customer .product-control.is-adding .select2-selection--single .select2-selection__arrow {
    background-image: none;
}
#edit_customer .product-control.is-adding .select2-selection--single .select2-selection__arrow b {
    display: none;
}
#edit_customer .product-control.is-adding .select2-selection--single .select2-selection__arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -9px 0 0 -9px;
    border: 2px solid #c3c4c7;
    border-top-color: var(--wp-admin-theme-color, #2271b1);
    border-radius: 50%;
    animation: sol-order-items-spin .7s linear infinite;
}
#edit_customer .product-control.is-adding .select2-selection--single::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40%;
    height: 3px;
    background-color: var(--wp-admin-theme-color, #2271b1);
    animation: sol-adding-product-bar 1.1s ease-in-out infinite;
}

@keyframes sol-adding-product-bar {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

/* Multi-select (never-send, etc. within this screen) gets the same box treatment */
#edit_customer .select2-container--default .select2-selection--multiple {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    min-height: 38px;
}
#edit_customer .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--wp-admin-theme-color, #0085ba);
    box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #0085ba);
}
#edit_customer .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    color: #1d2327;
    padding: 2px 8px;
}
#edit_customer .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #787c82;
    margin-right: 6px;
}
#edit_customer .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #a02722;
}

/* Dropdown panel: a real card instead of the bare browser box.
 *
 * Select2/selectWoo append the open dropdown to <body> by default (see
 * AttachBody.prototype in selectWoo.full.js: `dropdownParent` defaults to
 * $(document.body)), so it is NOT a descendant of #edit_customer at open
 * time -- #edit_customer-scoped rules never match it. Each selectWoo() call
 * for these selects instead sets `dropdownCssClass: 'sol-edit-customer-select-dropdown'`
 * (edit-customer.js), which selectWoo adds directly to the dropdown element
 * wherever it renders, so that class is the real scoping hook here. */
.sol-edit-customer-select-dropdown.select2-dropdown {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.sol-edit-customer-select-dropdown .select2-search--dropdown {
    padding: 8px;
}
.sol-edit-customer-select-dropdown .select2-search--dropdown .select2-search__field {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 6px 8px;
}
.sol-edit-customer-select-dropdown .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--wp-admin-theme-color, #0085ba);
    box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #0085ba);
    outline: 2px solid transparent;
}
.sol-edit-customer-select-dropdown .select2-results__option {
    padding: 7px 12px;
    white-space: nowrap;
}
/* Plain-text rows (address list has no custom template) still get a clean hover/hold.
 *
 * Verified empirically (jsdom + the real selectWoo.full.js from this install,
 * not just reading the source): the rendered .select2-dropdown element never
 * carries select2-container--default -- only select2-dropdown, the custom
 * dropdownCssClass, and its above/below positioning class. So the scoping
 * hook is .sol-edit-customer-select-dropdown alone; requiring
 * select2-container--default as a compound would never match anything. */
.sol-edit-customer-select-dropdown .select2-results__option--highlighted[aria-selected],
.sol-edit-customer-select-dropdown .select2-results__option--highlighted[data-selected] {
    background-color: var(--wp-admin-theme-color, #0085ba);
}
.sol-edit-customer-select-dropdown .select2-results__option[aria-selected=true],
.sol-edit-customer-select-dropdown .select2-results__option[data-selected=true] {
    background-color: #f0f6fc;
    color: #1d2327;
}
.sol-edit-customer-select-dropdown .select2-results__option[aria-disabled=true] {
    color: #a7aaad;
}

#products .delivery-container:nth-child(even) {
    background-color: initial;
}

/* Orders the customer paused from My Account (status on-hold) */
.delivery-container.order-on-hold,
.delivery-container.order-on-hold table.customer_products,
.delivery-container.order-on-hold table.customer_products.striped > tbody > tr,
.delivery-container.order-on-hold table.customer_products.striped > tbody > tr:nth-child(odd) {
    background-color: #fff8d6;
}
.delivery-container.order-on-hold {
    border-left: 4px solid #f0ad4e;
}
/* Line items are read-only while on hold; the order date in the header stays editable */
.delivery-container.order-on-hold table.customer_products tbody tr {
    cursor: default;
}
.delivery-container.order-on-hold table.customer_products td:first-child a {
    pointer-events: none;
    opacity: 0.35;
}
.delivery-container.order-on-hold table.customer_products input:disabled,
.delivery-container.order-on-hold table.customer_products select:disabled {
    background-color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}
.delivery-container.order-on-hold .order-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.delivery-container .on-hold-badge {
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
    padding: 3px 10px;
    background: #f0ad4e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

#products .delivery-container .delete-fee {
    cursor: pointer;
}

#products .delivery-container .delete-fee.disabled {
    color: #ccc;
    pointer-events: none;
    cursor: not-allowed;
}

.order-table tr.kf-packing-box.is-custom {
    background-color: #a0e2b0 !important;
}

.order-table tr.kf-packing-box.is-sub {
    background-color: rgb(178,194,253) !important;
}

.order-table tr.kf-packing-box {
    cursor:pointer;
}

.wp-list-table #visibility.manage-column.column-visibility {
    width: 60px;
}

.menu-email-order thead tr th {
    color: #000;
    font-weight: 700;
    text-decoration: underline;
    background-color: rgba(199, 191, 191, 0.5)
}

.menu-email-order tbody tr td {
    color: #000;
    font-weight: 450;
}

.menu-email-order tbody tr:nth-child(odd) {
    background-color: rgba(209, 149, 86, 0.5);
}

.menu-email-order tbody tr:nth-child(even) {
    background-color: white;
}

button.payment-actions.void {
    border-color: rgb(226, 156, 0);
    background-color: rgb(226, 156, 0);
    box-shadow: none;
    text-shadow: none;
    color: rgb(255, 255, 255);
    width: 75%;
}

button.payment-actions.delete {
    border-color: rgb(170, 0, 0);
    background-color: rgb(170, 0, 0);
    box-shadow: none;
    text-shadow: none;
    color: rgb(255, 255, 255);
    width: 75%;
}

button.payment-actions.refund {
    border-color: rgb(0, 103, 170);
    background-color: rgb(0, 103, 170);
    box-shadow: none;
    text-shadow: none;
    color: rgb(255, 255, 255);
    width: 75%;
}

button.payment-actions.declined {
    border-color: rgb(180, 178, 0);
    background-color: rgb(180, 178, 0);
    box-shadow: none;
    text-shadow: none;
    color: rgb(255, 255, 255);
    width: 75%;
}

/* Gateway decline/return reason next to the Declined button; text is in the title / tooltip */
.payment-error-info {
    margin-left: 4px;
    color: #a00;
    cursor: help;
    vertical-align: middle;
}


/* DataTables */
.kf-admin-table tr:nth-child(even) { background: #F1F1F1 }
.kf-admin-table tr:nth-child(odd) { background: #fff }

#customers-table_info 	{ margin-top: 10px; }

.dataTables_wrapper .dataTables_paginate .paginate_button {
    box-sizing: border-box;
    display: inline-block;
    min-width: 1.5em;
    padding: 0.5em 1em;
    margin-left: 2px;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    *cursor: hand;
    color: #333 !important;
    border: 1px solid transparent;
    border-radius: 2px
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #333 !important;
    border: 1px solid #979797;
    background-color: white;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));
    background: -webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);
    background: -moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);
    background: -ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);
    background: -o-linear-gradient(top, #fff 0%, #dcdcdc 100%);
    background: linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    cursor: default;
    color: #666 !important;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: white !important;
    border: 1px solid #111;
    background-color: #585858;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));
    background: -webkit-linear-gradient(top, #585858 0%, #111 100%);
    background: -moz-linear-gradient(top, #585858 0%, #111 100%);
    background: -ms-linear-gradient(top, #585858 0%, #111 100%);
    background: -o-linear-gradient(top, #585858 0%, #111 100%);
    background: linear-gradient(to bottom, #585858 0%, #111 100%)
}

.dataTables_wrapper .dataTables_paginate .paginate_button:active {
    outline: none;
    background-color: #2b2b2b;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));
    background: -webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
    background: -moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
    background: -ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
    background: -o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
    background: linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);
    box-shadow: inset 0 0 3px #111
}

table.dataTable th.focus, table.dataTable td.focus {
    outline: 0;
    outline-offset: 0;
}

.dataTables_wrapper .dataTables_paginate .ellipsis {
    padding: 0 1em
}

/* Category divider rows grouping like products together on the admin order screen. */
#delivery_container_parent table.customer_products tr.product-category-row td {
    padding-top: 2px;
    padding-bottom: 2px;
    background: #eef1f5;
    color: #3c434a;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 6px 12px;
    border-top: 1px solid #dcdcde;
    border-bottom: 1px solid #dcdcde;
}

/* --- Order card on the edit-customer page (View\Order::admin_order_display) ---
   Scoped to #delivery_container_parent so it outranks the legacy alternating
   dark headers at sol.css:37 and WP's .striped/.widefat defaults. */
#delivery_container_parent .delivery-container {
    --order-accent: var(--wp-admin-theme-color, #2271b1);
    background: #fff;
    border: 1px solid #c3c4c7;
    border-top: 4px solid var(--order-accent);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.06);
    margin: 0 0 24px;
}

/* Header */
#delivery_container_parent .delivery-container .order-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 36px;
    padding: 14px 20px;
    background: #f0f6fc;
    color: #1d2327;
    border-bottom: 1px solid #c5d9ed;
    border-radius: 4px 4px 0 0;
}

#delivery_container_parent .order-header .order-header-label {
    display: block;
    margin-bottom: 3px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #50575e;
}

#delivery_container_parent .order-header-name,
#delivery_container_parent .order-header-address,
/* .order-header-item: generic field added through cal_scheduled_order_header_items (e.g. sol-delivery's Route/Vehicle/Driver) */
#delivery_container_parent .order-header-item,
#delivery_container_parent .order-header-order {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    min-width: 0;
}

#delivery_container_parent .order-header .box-title {
    font-size: inherit;
    color: inherit;
}

#delivery_container_parent .order-header-name .order-name {
    font-size: 18px;
    font-weight: 700;
}

#delivery_container_parent .order-header-address .dashicons-location {
    margin-right: 2px;
    color: var(--order-accent);
    font-size: 18px;
    vertical-align: text-bottom;
}

/* Hover map: fixed so the scroll container's overflow can't clip it;
   top/left are set on mouseenter in edit-customer.js. */
#edit_customer .order-header-address .hover_map_container .map_container {
    position: fixed;
    float: none;
    z-index: 100000;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Bill to / Ship to variant */
#delivery_container_parent .order-header-address .name {
    font-weight: 700;
}
#delivery_container_parent .order-header-address .address {
    font-weight: 400;
    color: #3c434a;
}

#delivery_container_parent .order-header-date input.date-picker {
    width: 120px;
    min-height: 32px;
    border-radius: 6px;
}

#delivery_container_parent .order-header-order {
    margin-left: auto;
    text-align: right;
}

#delivery_container_parent .order-header-order .order-number {
    color: #1d2327;
    text-decoration: none;
}

#delivery_container_parent .order-header-order .order-number:hover {
    color: var(--order-accent);
    text-decoration: underline;
}

/* Named order-header-status, not order-status: WooCommerce's admin.css styles .order-status */
#delivery_container_parent .order-header-order-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

#delivery_container_parent .order-header-order .order-number {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

#delivery_container_parent .order-header-status {
    padding: 3px 9px;
    border-radius: 10px;
    background: #dcdcde;
    color: #2c3338;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Same palette WooCommerce uses for its order status labels */
#delivery_container_parent .order-header-status.status-processing { background: #c6e1c6; color: #2c4700; }
#delivery_container_parent .order-header-status.status-completed  { background: #c8d7e1; color: #003d66; }
#delivery_container_parent .order-header-status.status-on-hold    { background: #f8dda7; color: #573b00; }
#delivery_container_parent .order-header-status:is(.status-failed, .status-cancelled) { background: #eba3a3; color: #570000; }

/* Line-item table */
#delivery_container_parent table.customer_products {
    border: 0;
    box-shadow: none;
    border-radius: 0 0 7px 7px;
    background: transparent;
}

#delivery_container_parent table.customer_products > thead th {
    padding: 10px 12px;
    background: #fff;
    color: #50575e;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid #dcdcde;
}

#delivery_container_parent table.customer_products > tbody > tr > td {
    padding: 10px 12px;
    vertical-align: middle;
}

#delivery_container_parent table.customer_products > tbody > tr:not(.product-category-row) > td {
    border-bottom: 1px solid #f0f0f1;
}

/* Alternate product rows; the category rows are skipped so each group keeps the rhythm */
#delivery_container_parent table.customer_products > tbody > tr:nth-child(odd of :not(.product-category-row)) {
    background-color: #fff;
}
#delivery_container_parent table.customer_products > tbody > tr:nth-child(even of :not(.product-category-row)) {
    background-color: #f3f4f5;
}
#delivery_container_parent table.customer_products > tbody > tr:not(.product-category-row):hover {
    background-color: #eaecee;
}

/* Custom / substituted rows: sol.css:1390 floods them with an !important green or
   blue fill; on the order card keep the stripes and flag them with a bar and a tag. */
#delivery_container_parent table.customer_products > tbody > tr:is(.kf_product_custom, .kf_product_sub):not(.kf-row-dragging) {
    border: 0;
}
#delivery_container_parent table.customer_products > tbody > tr:is(.kf_product_custom, .kf_product_sub):not(.kf-row-dragging):nth-child(odd of :not(.product-category-row)) {
    background-color: #fff !important;
}
#delivery_container_parent table.customer_products > tbody > tr:is(.kf_product_custom, .kf_product_sub):not(.kf-row-dragging):nth-child(even of :not(.product-category-row)) {
    background-color: #f3f4f5 !important;
}
#delivery_container_parent table.customer_products > tbody > tr:is(.kf_product_custom, .kf_product_sub):not(.kf-row-dragging):hover {
    background-color: #eaecee !important;
}
#delivery_container_parent table.customer_products > tbody > tr.kf_product_custom > td:first-child {
    box-shadow: inset 4px 0 0 #00a32a;
}
#delivery_container_parent table.customer_products > tbody > tr.kf_product_sub > td:first-child {
    box-shadow: inset 4px 0 0 #2271b1;
}
#delivery_container_parent tr:is(.kf_product_custom, .kf_product_sub) .order-item-details .kf_label::after {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: 2px;
}
#delivery_container_parent tr.kf_product_custom .order-item-details .kf_label::after {
    content: "Custom";
    background: #edfaef;
    color: #007017;
}
#delivery_container_parent tr.kf_product_sub .order-item-details .kf_label::after {
    content: "Substituted";
    background: #e7f0fa;
    color: #135e96;
}

/* Keep paused orders in their on-hold yellow */
#delivery_container_parent .delivery-container.order-on-hold {
    border-top-color: #f0ad4e;
}
#delivery_container_parent .delivery-container.order-on-hold .order-header {
    background: #fff3c4;
    border-bottom-color: #f0d68a;
}
#delivery_container_parent .delivery-container.order-on-hold table.customer_products > tbody > tr:not(.product-category-row) {
    background-color: #fff8d6;
}

/* Actions column */
#delivery_container_parent table.customer_products td.order-item-actions {
    width: 1%;
    white-space: nowrap;
}

#delivery_container_parent table.customer_products td.order-item-actions .dashicons {
    width: 18px;
    height: 18px;
    margin-right: 4px;
    padding: 5px;
    border: 1px solid #c5d9ed;
    border-radius: 6px;
    background-color: #f0f6fc;
    color: var(--order-accent);
    font-size: 18px;
    line-height: 18px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

#delivery_container_parent table.customer_products td.order-item-actions .dashicons:hover {
    background-color: var(--order-accent);
    border-color: var(--order-accent);
    color: #fff;
}

/* Delete carries an inline color, hence the !important */
#delivery_container_parent table.customer_products td.order-item-actions .admin_order_delete_product {
    border-color: #f1c0c0;
    background-color: #fcf0f1;
    color: #d63638 !important;
}
#delivery_container_parent table.customer_products td.order-item-actions .admin_order_delete_product:hover {
    border-color: #d63638;
    background-color: #d63638;
    color: #fff !important;
}

/* Row greyed out while its delete request is in flight */
#delivery_container_parent table.customer_products tr.is-deleting {
    opacity: 0.4;
    filter: grayscale(1);
    pointer-events: none;
    transition: opacity 0.15s ease;
}

#delivery_container_parent table.customer_products td.order-item-actions .edit_product {
    border-color: #b8e6bf;
    background-color: #edfaef;
    color: #007017;
}
#delivery_container_parent table.customer_products td.order-item-actions .edit_product:hover {
    border-color: #008a20;
    background-color: #008a20;
    color: #fff;
}

/* Product label cell with thumbnail */
#delivery_container_parent .customer_products td.order-item-label-cell {
    min-width: 300px;
    max-width: none;
}

#delivery_container_parent .order-item-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Indent the "Label" heading past the thumbnail (48px + 12px gap) and the
   cell's 12px padding so it sits over the product name, not the image. */
#delivery_container_parent .customer_products th.order-item-label-head {
    padding-left: 74px;
}

#delivery_container_parent .order-item-label .order-item-thumb {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #fff;
}

#delivery_container_parent .order-item-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
    min-width: 0;
}

#delivery_container_parent .order-item-details .kf_label a {
    font-size: 14px;
    font-weight: 600;
    color: var(--order-accent);
    text-decoration: none;
}

#delivery_container_parent .order-item-details .kf_label a:hover {
    text-decoration: underline;
}

#delivery_container_parent .order-item-meta {
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #50575e;
}

#delivery_container_parent .order-item-meta b {
    color: #1d2327;
    font-weight: 600;
}

/* Custom fields (Project, Task, Notes...) as a two-column label/value grid */
#delivery_container_parent .order-item-fields {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 3px 12px;
    margin: 6px 0 0;
    padding: 6px 10px;
    border-left: 2px solid #dcdcde;
    background: rgba(0, 0, 0, 0.025);
    border-radius: 0 4px 4px 0;
}

#delivery_container_parent .order-item-fields dt {
    color: #646970;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 19px;
    text-transform: uppercase;
}

#delivery_container_parent .order-item-fields dd {
    margin: 0;
    color: #1d2327;
    line-height: 19px;
    overflow-wrap: anywhere;
}

/* Item notes: the Edit item dialog's note list + form (Notes::render_item_notes_panel) */
.sol-item-notes {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #dcdcde;
}

.sol-item-notes__title {
    margin: 0 0 10px;
    font-size: 13px;
}

.sol-item-notes__empty {
    margin: 0 0 12px;
    color: #646970;
}

.sol-item-notes__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.sol-item-note {
    margin: 0;
    padding: 6px 10px 8px;
    border-left: 3px solid #8c8f94;
    border-radius: 0 4px 4px 0;
    background: #f6f7f7;
}

.sol-item-note--fulfillment { border-left-color: #2271b1; }
.sol-item-note--delivery { border-left-color: #b26200; }

.sol-item-note.is-deleting {
    opacity: 0.45;
    pointer-events: none;
}

.sol-item-note__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    font-size: 11px;
    color: #646970;
}

.sol-item-note__type {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1d2327;
}

.sol-item-note__delete {
    margin-left: auto;
    padding: 0 4px;
    border: 0;
    background: none;
    color: #8c8f94;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.sol-item-note__delete:hover {
    color: #b32d2e;
}

.sol-item-note__text {
    overflow-wrap: anywhere;
}

.sol-item-notes__content {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.sol-item-notes__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.sol-item-notes__controls .button {
    margin-left: auto;
}

#delivery_container_parent .order-item-fields dt.order-item-note-label span {
    cursor: help;
}

/* Inputs */
#delivery_container_parent table.customer_products input[type="text"],
#delivery_container_parent table.customer_products select {
    min-height: 32px;
    border-color: #c3c4c7;
    border-radius: 6px;
}

/* Totals footer */
#delivery_container_parent table.customer_products > tfoot td {
    padding: 0;
    background: #f6f7f7;
    border-top: 1px solid #dcdcde;
    border-radius: 0 0 7px 7px;
}

#delivery_container_parent .order-totals {
    display: flex;
    flex-wrap: wrap;
}

#delivery_container_parent .order-totals-item {
    flex: 1 1 0;
    min-width: 110px;
    padding: 12px 20px;
    border-right: 1px solid #e2e4e7;
}

#delivery_container_parent .order-totals-item:last-child {
    border-right: 0;
}

/* Subtotal and Total sit together on the right */
#delivery_container_parent .order-totals-subtotal,
#delivery_container_parent .order-totals-grand {
    flex: 0 0 160px;
}

#delivery_container_parent .order-totals-subtotal {
    margin-left: auto;
    background: #eceef0;
    border-left: 1px solid #dcdcde;
    border-right: 0;
}

#delivery_container_parent .order-totals-subtotal .order-totals-value {
    font-size: 15px;
    font-weight: 600;
}

#delivery_container_parent .order-totals-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #646970;
}

#delivery_container_parent .order-totals-label[title]:not([title=""]) {
    cursor: help;
    text-decoration: underline dotted;
}

#delivery_container_parent .order-totals-value {
    font-size: 14px;
    font-weight: 500;
    color: #1d2327;
}

#delivery_container_parent .order-totals-grand {
    background: var(--order-accent);
    border-bottom-right-radius: 7px;
}

#delivery_container_parent .order-totals-grand .order-totals-label {
    color: rgba(255, 255, 255, 0.85);
}

#delivery_container_parent .order-totals-grand .order-totals-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

@media screen and (max-width: 767px) {
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center
    }
    .dataTables_wrapper .dataTables_paginate {
        margin-top: 0.5em
    }
}

@media screen and (max-width: 640px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: center
    }
    .dataTables_wrapper .dataTables_filter {
        margin-top: 0.5em
    }
}

/* For whatever reason, the daterangepicker defaults to display, rather than wait for click on the element it's attached to */
.daterangepicker {display:none;}

/* Fix KF Route buttons from "jumping" when clicked */
ul.subsubsub li button.button-primary:active {
    vertical-align: initial;
}
/* Make all the note input/select fields the same height */
[name*="add_note"] {
    height:38px;
}

/* Make search in select2/Woo respect its container width */
.select2-container .select2-dropdown .select2-search .select2-search__field {
    min-width: 0px;
}

/* Product search results: featured image thumbnail beside the product label */
.sol-product-result {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}
.sol-product-result__thumb {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 3px;
    background-color: #f0f0f1;
}
.sol-product-result__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Placeholder for a product or variation with no image of its own, so rows stay
   aligned. The icon is an inline SVG data URI rather than a dashicon: dashicons is
   only enqueued on the frontend by this plugin, and a data URI costs no request. */
.sol-product-result__thumb--empty,
.sol-product-group__thumb--empty {
    display: inline-block;
    border: 1px dashed #dcdcde;
    background-color: #fbfbfc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7aaad' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.6'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    box-sizing: border-box;
}
/* The group thumb is smaller, so scale the icon to match */
.sol-product-group__thumb--empty {
    background-size: 14px 14px;
}

/* ---- Variable product headings -------------------------------------------
   selectWoo renders a result with children into a <strong class="select2-results__group">
   with role="presentation" and no data-selected attribute, so it can never be
   hovered or selected. These rules make that structural fact visible: the row is
   a heading for the variations beneath it, not an option that happens to be dead. */
.select2-results__group {
    /* Tinted band with a rule underneath, so the group reads as a section header */
    background-color: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    padding: 8px 6px 7px !important;
    margin-bottom: 2px;
    cursor: default;
}
.sol-product-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}
.sol-product-group__thumb {
    flex: 0 0 auto;
    /* Deliberately smaller than a selectable row's 32px thumb */
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 3px;
    background-color: #f0f0f1;
    opacity: 0.85;
}
.sol-product-group__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.sol-product-group__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #50575e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sol-product-group__hint {
    font-size: 11px;
    font-weight: 400;
    font-style: italic;
    color: #787c82;
    white-space: nowrap;
}
.sol-product-group--empty {
    opacity: 0.55;
}
/* Indent the selectable variations so the hierarchy is unmistakable. Select2 only
   applies 1em, which the 32px thumbnail swamps. */
.select2-results__options .select2-results__option .select2-results__option {
    padding-left: 22px;
}
/* Badges sit right-aligned so values line up down the list */
.sol-product-badges {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}
/* Filled like the stock badge so it stays legible against the dark blue hover */
.sol-product-cogs {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.6;
    font-weight: 600;
    background-color: #eef1f6;
    color: #3c434a;
    white-space: nowrap;
}
.sol-product-cogs--inherited {
    font-style: italic;
    color: #646970;
}
.sol-product-stock {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.6;
    font-weight: 600;
    white-space: nowrap;
}
.sol-product-stock--in-stock {
    background-color: #edfaef;
    color: #1c6b30;
}
.sol-product-stock--low-stock {
    background-color: #fcf4e4;
    color: #8a5700;
}
.sol-product-stock--out-of-stock {
    background-color: #fcebea;
    color: #a02722;
}
.sol-product-stock--on-backorder {
    background-color: #f0f0f1;
    color: #50575e;
}
.sol-product-expiration {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.6;
    font-weight: 600;
    white-space: nowrap;
}
.sol-product-expiration--soon {
    background-color: #fcf4e4;
    color: #8a5700;
}
.sol-product-expiration--expired {
    background-color: #fcebea;
    color: #a02722;
}
.sol-product-expiration--awaiting {
    background-color: #f0f0f1;
    color: #50575e;
}
.sol-product-expiration--inherited {
    font-style: italic;
}
/* Menu lookup: when the product was last on a menu. Recently used reads amber (worth a second
   look before repeating it), never used reads neutral. */
.sol-product-lastused {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.6;
    font-weight: 600;
    white-space: nowrap;
    background-color: #eef1f6;
    color: #3c434a;
}
.sol-product-lastused--recent {
    background-color: #fcf4e4;
    color: #8a5700;
}
.sol-product-lastused--upcoming {
    background-color: #edfaef;
    color: #1c6b30;
}
.sol-product-lastused--never {
    background-color: #f0f0f1;
    color: #50575e;
}
/* Same guard as the other badges against the white text of a highlighted row */
.sol-product-select-dropdown .select2-results__option--highlighted[aria-selected] .sol-product-lastused,
.sol-product-select-dropdown .select2-results__option--highlighted[data-selected] .sol-product-lastused {
    color: #3c434a;
}
.sol-product-select-dropdown .select2-results__option--highlighted[aria-selected] .sol-product-lastused--recent,
.sol-product-select-dropdown .select2-results__option--highlighted[data-selected] .sol-product-lastused--recent {
    color: #8a5700;
}
.sol-product-select-dropdown .select2-results__option--highlighted[aria-selected] .sol-product-lastused--upcoming,
.sol-product-select-dropdown .select2-results__option--highlighted[data-selected] .sol-product-lastused--upcoming {
    color: #1c6b30;
}
.sol-product-select-dropdown .select2-results__option--highlighted[aria-selected] .sol-product-lastused--never,
.sol-product-select-dropdown .select2-results__option--highlighted[data-selected] .sol-product-lastused--never {
    color: #50575e;
}
/* The expiration badge on a group heading sits after the "N options" hint */
.sol-product-group .sol-product-expiration {
    margin-left: 8px;
}
/* Select2's hover rule sets `color: #fff` on the whole row, which would otherwise
   inherit into the badges and wash them out against the dark blue highlight.
   These selectors match its specificity so the badges keep their own colors. */
.select2-container--default .select2-results__option--highlighted[aria-selected] .sol-product-cogs,
.select2-container--default .select2-results__option--highlighted[data-selected] .sol-product-cogs,
.select2-container--classic .select2-results__option--highlighted[aria-selected] .sol-product-cogs,
.select2-container--classic .select2-results__option--highlighted[data-selected] .sol-product-cogs {
    background-color: #fff;
    color: #3c434a;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] .sol-product-cogs--inherited,
.select2-container--default .select2-results__option--highlighted[data-selected] .sol-product-cogs--inherited,
.select2-container--classic .select2-results__option--highlighted[aria-selected] .sol-product-cogs--inherited,
.select2-container--classic .select2-results__option--highlighted[data-selected] .sol-product-cogs--inherited {
    color: #646970;
}
/* Same guard for the stock badges: their tints are pale, so inheriting white text
   from the highlighted row would make them unreadable too. */
.select2-container--default .select2-results__option--highlighted[aria-selected] .sol-product-stock--in-stock,
.select2-container--default .select2-results__option--highlighted[data-selected] .sol-product-stock--in-stock,
.select2-container--classic .select2-results__option--highlighted[aria-selected] .sol-product-stock--in-stock,
.select2-container--classic .select2-results__option--highlighted[data-selected] .sol-product-stock--in-stock {
    color: #1c6b30;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] .sol-product-stock--low-stock,
.select2-container--default .select2-results__option--highlighted[data-selected] .sol-product-stock--low-stock,
.select2-container--classic .select2-results__option--highlighted[aria-selected] .sol-product-stock--low-stock,
.select2-container--classic .select2-results__option--highlighted[data-selected] .sol-product-stock--low-stock {
    color: #8a5700;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] .sol-product-stock--out-of-stock,
.select2-container--default .select2-results__option--highlighted[data-selected] .sol-product-stock--out-of-stock,
.select2-container--classic .select2-results__option--highlighted[aria-selected] .sol-product-stock--out-of-stock,
.select2-container--classic .select2-results__option--highlighted[data-selected] .sol-product-stock--out-of-stock {
    color: #a02722;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] .sol-product-stock--on-backorder,
.select2-container--default .select2-results__option--highlighted[data-selected] .sol-product-stock--on-backorder,
.select2-container--classic .select2-results__option--highlighted[aria-selected] .sol-product-stock--on-backorder,
.select2-container--classic .select2-results__option--highlighted[data-selected] .sol-product-stock--on-backorder {
    color: #50575e;
}
/* Same guard for the expiration badge */
.select2-container--default .select2-results__option--highlighted[aria-selected] .sol-product-expiration--soon,
.select2-container--default .select2-results__option--highlighted[data-selected] .sol-product-expiration--soon,
.select2-container--classic .select2-results__option--highlighted[aria-selected] .sol-product-expiration--soon,
.select2-container--classic .select2-results__option--highlighted[data-selected] .sol-product-expiration--soon {
    color: #8a5700;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] .sol-product-expiration--expired,
.select2-container--default .select2-results__option--highlighted[data-selected] .sol-product-expiration--expired,
.select2-container--classic .select2-results__option--highlighted[aria-selected] .sol-product-expiration--expired,
.select2-container--classic .select2-results__option--highlighted[data-selected] .sol-product-expiration--expired {
    color: #a02722;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] .sol-product-expiration--awaiting,
.select2-container--default .select2-results__option--highlighted[data-selected] .sol-product-expiration--awaiting,
.select2-container--classic .select2-results__option--highlighted[aria-selected] .sol-product-expiration--awaiting,
.select2-container--classic .select2-results__option--highlighted[data-selected] .sol-product-expiration--awaiting {
    color: #50575e;
}
/* Variation rows sit inside an optgroup, so keep their thumbs a touch smaller */
.select2-results__option .select2-results__options .sol-product-result__thumb {
    width: 26px;
    height: 26px;
}

/* ---- Product search grouping ---------------------------------------------
   Every top-level result is its own bordered card, so one product never visually
   bleeds into the next:
     - variable product: blue accent bar, tinted header, and its variations boxed
       inside the card with a tree connector
     - simple product:   neutral grey accent bar, a single row
   Scoped to the product search dropdown (edit customer, fulfillment, notifications). */
.sol-product-select-dropdown .select2-results__options {
    padding: 2px 0;
}
.sol-product-select-dropdown .select2-results > .select2-results__options > li.select2-results__option {
    margin: 0 8px 8px;
    border: 1px solid #dcdcde;
    border-left: 4px solid #a7aaad;
    border-radius: 5px;
    background: #fff;
    overflow: hidden;
}
/* The white card above out-ranks the highlight color of a simple product's row, which left white
   text on a white row wherever the page doesn't add its own highlight (the Menu screen). */
.sol-product-select-dropdown .select2-results > .select2-results__options > li.select2-results__option--highlighted[aria-selected],
.sol-product-select-dropdown .select2-results > .select2-results__options > li.select2-results__option--highlighted[data-selected] {
    background-color: var(--wp-admin-theme-color, #0085ba);
    color: #fff;
}
/* Same color on a variation row, and no focus ring: selectWoo focuses the highlighted option, and
   the highlight already marks it. */
.sol-product-select-dropdown li.select2-results__option--highlighted[aria-selected],
.sol-product-select-dropdown li.select2-results__option--highlighted[data-selected] {
    background-color: var(--wp-admin-theme-color, #0085ba);
    color: #fff;
}
.sol-product-select-dropdown .select2-results__option:focus {
    outline: none;
}
/* Messages ("Searching...", "No results") are not products */
.sol-product-select-dropdown .select2-results > .select2-results__options > .select2-results__message {
    margin: 0;
    border: 0;
    border-radius: 0;
}
.sol-product-select-dropdown .select2-results > .select2-results__options > li.select2-results__option[role=list] {
    padding: 0;
    border-left-color: var(--wp-admin-theme-color, #3858e9);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.sol-product-select-dropdown .select2-results > .select2-results__options > li.select2-results__option[role=list][aria-disabled=true],
.sol-product-select-dropdown .select2-results > .select2-results__options > li.select2-results__option[role=list]:has(> .select2-results__group .sol-product-group--empty) {
    border-left-color: #c3c4c7;
}
.sol-product-select-dropdown .select2-results__group {
    display: block;
    margin: 0;
    padding: 8px 12px !important;
    background-color: #eef1fd;
    border-bottom: 1px solid #d5dbf5;
}
.sol-product-select-dropdown .select2-results__options--nested {
    margin: 0;
    padding: 0;
}
/* Variations: indented under the header with an elbow connector to the trunk line */
.sol-product-select-dropdown .select2-results__options--nested > li.select2-results__option {
    position: relative;
    padding: 6px 12px 6px 44px;
    border-top: 1px solid #f0f0f1;
}
.sol-product-select-dropdown .select2-results__options--nested > li.select2-results__option:first-child {
    border-top: 0;
}
.sol-product-select-dropdown .select2-results__options--nested > li.select2-results__option::before {
    /* trunk */
    content: "";
    position: absolute;
    left: 22px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #c5cdf0;
}
.sol-product-select-dropdown .select2-results__options--nested > li.select2-results__option:last-child::before {
    bottom: 50%;
}
.sol-product-select-dropdown .select2-results__options--nested > li.select2-results__option::after {
    /* elbow */
    content: "";
    position: absolute;
    left: 22px;
    top: 50%;
    width: 12px;
    height: 2px;
    background: #c5cdf0;
}
/* "N options" pill beside the product name */
.sol-product-select-dropdown .sol-product-group__text {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sol-product-select-dropdown .sol-product-group__hint {
    font-style: normal;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    background: #dde3fb;
    color: #2c3a8c;
}
.sol-product-select-dropdown .sol-product-group--empty .sol-product-group__hint {
    background: #e6e6e8;
    color: #646970;
}

#add_payment_form .form-row {
    margin: auto;
}
#add_payment_form .form-row input {
    margin: auto;
}

.form-header {
    display: flex;
    padding: 0 10px;
    background-color: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.form-header.tab-content {
    border-top: none;
}

.form-header .filter-container {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
}

.form-header .actions-container {
    display: flex;
    align-items: center;
}

.form-header .actions-container button {
    margin-right: 10px;
}

.form-header .filter-control {
    padding: 5px 0 10px 0;
    margin-right: 20px;
}

.form-header .filter-control.checkbox {
    padding-top: 32px;
}

.form-header .filter-label {
    margin-bottom: 5px;
}

#charge_balances .date-range {
    width: 175px;
}

#charge_balances input[name="min_balance"], #charge_balances input[name="limit"] {
    width: 80px;
}

#charge_balances .form-header {
    margin-bottom: 20px;
}

#update_account_details .dashicons {
    cursor:pointer;
}

.filter-control .form-row select {
    margin: 0;
    padding: 0 24px 0 8px;
    
}

.edit-customer .fulfillment-header .filter-container {
    margin: 0 !important;
    padding: 10px 0 5px 0;
    border-top: none;
}

.fulfillment-header .product-control {
    flex: 1;
    min-width: 250px;
    /* Widened from 350px: search results now carry a thumbnail plus up to three
       badges (stock, COGS, expiration). selectWoo's dropdownAutoWidth mirrors the
       trigger's width, so a trigger too narrow for that content leaves the dropdown
       wider than the search box above it -- this keeps the two edges lined up. */
    max-width: 480px;
}

.fulfillment-header .address-control {
    flex: 1;
    min-width: 350px;
    max-width: 400px;
}

.fulfillment-header .payment-control {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.fulfillment-header .custom-control {
    max-width: 350px;
}

#add_payment_method .woocommerce-error {
    color: red;
}

#addresses .fulfillment-header .select2-container .select2-selection--single {
    margin: 0 !important;
}

#addresses .header-checkbox-container {
    display: flex;
    align-items: center;
    height: 100%; 
}

#addresses .header-checkbox-container label {
    display: block;
}

#addresses .address-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 10px;
}

/* Toggle switch: a visually hidden checkbox followed by a styled track */
.sol-switch {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.sol-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.sol-switch__track {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: #8c8f94;
    transition: background-color 0.15s ease-in-out;
}

.sol-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease-in-out;
}

.sol-switch input:checked + .sol-switch__track {
    background: #2271b1;
}

.sol-switch input:checked + .sol-switch__track::after {
    transform: translateX(16px);
}

.sol-switch input:focus-visible + .sol-switch__track {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1;
}

/* Admin cards (SOL\View\Card) */
.sol-card {
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
    overflow: hidden;
}

.sol-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 24px;
    padding: 10px 16px;
    border-bottom: 1px solid #dcdcde;
    background: #f6f7f7;
    color: #1d2327;
    font-size: 14px;
    font-weight: 600;
}

.sol-card__header .dashicons {
    color: #646970;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.sol-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
    font-weight: normal;
}

/* Header buttons: big enough to tap, and a long label (e.g. "Shop As <name>") truncates instead of overflowing.
   .wp-core-ui prefix beats WP's .wp-core-ui .button-small (11px, 24px tall). */
.wp-core-ui .sol-card__actions .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    max-width: 100%;
    padding: 0 10px;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sol-card__body {
    padding: 16px;
}

.sol-card--flush .sol-card__body {
    padding: 0;
}

/* Cards laid out side by side, wrapping as the space narrows */
.sol-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}

/* Form table with each label stacked above its input. The table element in the
   selectors outranks WordPress's .form-table rules regardless of load order. */
table.sol-stacked-form,
table.sol-stacked-form tbody,
table.sol-stacked-form tr,
table.sol-stacked-form th,
table.sol-stacked-form td {
    display: block;
    width: auto;
}

table.sol-stacked-form {
    margin-top: 0;
}

table.sol-stacked-form tr {
    margin-bottom: 12px;
}

table.sol-stacked-form th {
    padding: 0 0 4px;
    font-size: 13px;
    line-height: 1.4;
}

table.sol-stacked-form td {
    margin: 0;
    padding: 0;
    overflow-wrap: anywhere;
}

table.sol-stacked-form td p.form-row {
    margin: 0;
    padding: 0;
}

table.sol-stacked-form input[type="text"],
table.sol-stacked-form input[type="email"],
table.sol-stacked-form input[type="tel"],
table.sol-stacked-form input[type="number"],
table.sol-stacked-form select {
    width: 100%;
    max-width: 100%;
}

/* .form-row select adds 5px vertical padding on top of core's 40px line-height, pushing the text low */
table.sol-stacked-form select {
    padding-top: 0;
    padding-bottom: 0;
}

/* Single checkboxes: label beside the box, rows packed tighter */
table.sol-stacked-form tr.sol-stacked-form__checkbox {
    margin-bottom: 6px;
}

table.sol-stacked-form label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Last row in a card shouldn't add space above the card's bottom padding */
table.sol-stacked-form tr:last-child {
    margin-bottom: 0;
}

/* selectWoo writes an inline pixel width */
table.sol-stacked-form .select2-container {
    width: 100% !important;
}

/* Admin address editor: contact / address / other fields / notifications, then the map.
   Breakpoints follow the editor's own width, not the viewport's. */
#edit_address {
    container-type: inline-size;
}

.edit-address-columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(260px, 1.2fr);
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}

.edit-address-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* The add-address modal prints a global #map_parent margin; not wanted inside the card */
.edit-address-column--map #map_parent {
    margin-top: 0;
}

.edit-address-column--map #delivery_area_map {
    display: block;
}

.edit-address-column--wide {
    grid-column: span 2;
}

@container (max-width: 1100px) {
    .edit-address-columns {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .edit-address-column--map {
        grid-column: 1 / -1;
    }
}

@container (max-width: 860px) {
    .edit-address-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (max-width: 640px) {
    .edit-address-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .edit-address-column--wide {
        grid-column: 1 / -1;
    }
}

.delivery-container .box-header {
    padding: 10px 0;
}
.delivery-container .box-header-parent {
    align-items: center;
}
.delivery-container .box-header-child {
    padding-bottom: 0;
}

#delivery_container_parent {
    min-width: 960px;
}

#edit_customer .account-details-wrapper {
    position: sticky;
    top: 32px;
    padding-top: 12px;
    background-color:#f0f0f1;
    z-index: 100;
}

/* ---- Page header: one card holding the customer summary, the tab strip and,
   when the active tab has one, that tab's toolbar (.fulfillment-header) ---- */

#edit_customer {
    --sol-header-border: #c3c4c7;
    --sol-header-divider: #c3c4c7;
    --sol-header-summary-bg: color-mix(in srgb, var(--wp-admin-theme-color, #0085ba) 12%, #fff);
    --sol-header-toolbar-bg: color-mix(in srgb, var(--wp-admin-theme-color, #0085ba) 4%, #fff);
}

/* ---- Customer summary (name / email / phone / balance) ------------------ */

#edit_customer .sol-customer-header {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(160px, 1fr));
    /* Tinted so the summary reads as its own band above the white tab strip */
    background: var(--sol-header-summary-bg);
    border: 1px solid var(--sol-header-border);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

#edit_customer .sol-customer-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 14px 20px;
    transition: background-color .15s ease;
}

#edit_customer .sol-customer-card + .sol-customer-card {
    border-left: 1px solid #c3c4c7;
}

#edit_customer .sol-customer-card:first-child { border-top-left-radius: 7px; }
#edit_customer .sol-customer-card:last-child { border-top-right-radius: 7px; }

#edit_customer .sol-customer-card--name {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

#edit_customer .sol-customer-card--name > .dashicons {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    font-size: 22px;
    line-height: 38px;
    text-align: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1px #dcdcde;
    color: var(--wp-admin-theme-color, #0085ba);
}

#edit_customer .sol-customer-card--name h2.customer-label {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    color: #1d2327;
    overflow-wrap: anywhere;
}

/* Icon button inset at the right of its own card, vertically centred, so it can't be mistaken for
   part of the neighbouring card. Padding on the card keeps its content clear of it. */
#edit_customer .sol-customer-card:has(.sol-customer-card__action) {
    padding-right: 60px;
}

#edit_customer .sol-customer-card__action {
    position: absolute;
    top: 50%;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: -16px 0 0;
    padding: 0;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    background: #fff;
    color: #50575e;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

#edit_customer .sol-customer-card__action:hover,
#edit_customer .sol-customer-card__action:focus-visible {
    border-color: var(--wp-admin-theme-color, #0085ba);
    background: var(--wp-admin-theme-color, #0085ba);
    color: #fff;
}

#edit_customer .sol-customer-card__action:focus-visible {
    outline: 2px solid var(--wp-admin-theme-color, #0085ba);
    outline-offset: 2px;
}

#edit_customer .sol-customer-card__action .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 1;
}

#edit_customer .sol-customer-card__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #3c434a;
}

#edit_customer .sol-customer-card__label .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #50575e;
}

#edit_customer .sol-customer-card__value {
    display: block;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    color: #1d2327;
    overflow-wrap: anywhere;
}

#edit_customer .sol-customer-card a.sol-open-modal {
    display: block;
    min-width: 0;
    text-decoration: none;
}

/* Long emails stay on one line; full address is in the title tooltip and the copy icon */
#edit_customer .sol-customer-card .customer-email-value {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow-wrap: normal;
}

#edit_customer .sol-customer-card a.sol-open-modal .sol-customer-card__value,
#edit_customer #customer_phone_label {
    color: var(--wp-admin-theme-color, #0085ba);
    cursor: pointer;
}

#edit_customer .sol-customer-card a.sol-open-modal:hover .sol-customer-card__value,
#edit_customer #customer_phone_label:hover {
    text-decoration: underline;
}

/* Copy-to-clipboard icons */
#edit_customer .sol-copy {
    cursor: copy;
    transition: color .15s ease, background-color .15s ease;
}

#edit_customer .sol-copy:hover {
    color: var(--wp-admin-theme-color, #0085ba);
}

#edit_customer .sol-copy.is-copied,
#edit_customer .sol-copy.is-copied:hover {
    color: #00a32a;
}

#edit_customer .sol-customer-card--name > .sol-copy.is-copied {
    background: #edfaef;
}

#edit_customer .sol-copy.is-copied::after {
    content: "Copied";
    position: absolute;
    top: -8px;
    left: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #1d2327;
    color: #fff;
    font: 600 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    pointer-events: none;
}

/* Flash after a successful save from the Edit Customer modal */
#edit_customer .sol-customer-header.is-updated .sol-customer-card {
    animation: sol-card-updated 1.6s ease-out;
}

@keyframes sol-card-updated {
    0%, 30% { background-color: #edfaef; }
}

/* ---- Tab strip: bottom row of the header card --------------------------- */

/* The generic .container wrapper around the tabs can pick up a width/max-width
   from other admin CSS, leaving the strip narrower than the header above it. */
#edit_customer .account-details-wrapper > .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

#edit_customer .nav-tab-wrapper {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 16px;
    border-color: var(--sol-header-border);
    /* Heavier rule between the customer summary and the tabs */
    border-top-width: 2px;
    border-radius: 0 0 8px 8px;
}

/* Selected tab: the 3px underline from sol.css alone was easy to miss, so give
   the active tab a thicker rule, a tinted fill and theme-colored text. All
   tabs get the 4px (transparent) rule so switching tabs doesn't shift anything.
   Edit Customer only; the Settings tabs share the base look and keep it. */
#edit_customer .nav-tab-wrapper .nav-tab {
    border-bottom-width: 4px;
    padding-bottom: 10px;
    border-radius: 6px 6px 0 0;
}

#edit_customer .nav-tab-wrapper .nav-tab.nav-tab-active,
#edit_customer .nav-tab-wrapper .nav-tab.nav-tab-active:hover {
    background: color-mix(in srgb, var(--wp-admin-theme-color, #0085ba) 10%, #fff);
    color: var(--wp-admin-theme-color, #0085ba);
    font-weight: 700;
}

/* The active tab goes bold, which would widen it and nudge its neighbours. Reserve
   the bold width on every tab with a hidden bold copy of the label (data-label). */
#edit_customer .nav-tab-wrapper .nav-tab-label {
    display: inline-block;
}

#edit_customer .nav-tab-wrapper .nav-tab-label::after {
    content: attr(data-label);
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    font-weight: 700;
    pointer-events: none;
}

/* ---- Tab toolbar: joins the header card when the visible tab starts with one.
   Panels are toggled with jQuery show()/hide(), so the hidden ones carry display:none inline. */
#edit_customer:has(.content-wrapper:not([style*="none"]) .fulfillment-header) .nav-tab-wrapper {
    margin-bottom: 0;
    border-bottom-color: var(--sol-header-divider);
    border-radius: 0;
    box-shadow: none;
}

#edit_customer .content-wrapper .fulfillment-header .filter-container {
    border: 1px solid var(--sol-header-border);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    background-color: var(--sol-header-toolbar-bg);
}

#edit_customer .content-wrapper .fulfillment-page {
    margin-bottom: 16px;
}

/* Orders toolbar: caption above each control, same look as the order card's
   .order-header-label. flex-end keeps the optional button from
   .custom-control (e.g. Substitutions) level with the inputs. */
#edit_customer .fulfillment-header .filter-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #50575e;
}

#edit_customer .fulfillment-header .filter-container {
    align-items: flex-end;
}

/* The date input rendered 2px taller than the select2 boxes beside it (WP's
   40px min-height on text inputs); make the three line up. */
#edit_customer .fulfillment-header input#delivery_date {
    box-sizing: border-box;
    min-height: 38px;
    height: 38px !important;
}

/* View\Toolbar controls (Order History, Activity) */
#edit_customer .sol-toolbar {
    align-items: center;
}

#edit_customer .sol-toolbar-search {
    width: 280px;
    max-width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 4px;
}

#edit_customer .sol-toolbar select {
    min-width: 180px;
    min-height: 40px;
    padding: 0 28px 0 12px;
}

#edit_customer .sol-toolbar-hint {
    font-size: 13px;
    color: #50575e;
}

#edit_customer .sol-toolbar-hint:empty {
    display: none;
}

/* Order History table. Columns are keyed (View\Order::admin_get_order_table, plus sol-delivery's).
   Every column hugs its content (width: 1%) except Ship To, which is the elastic one: it absorbs
   the table's leftover width and is the only column that wraps. */
#customer_orders_table {
    table-layout: auto;
}

#customer_orders_table > thead > tr > th,
#customer_orders_table > tbody > tr[data-order_id] > td {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

#customer_orders_table > thead > tr > th.column-ship_to,
#customer_orders_table > tbody > tr[data-order_id] > td.column-ship_to {
    width: auto;
    min-width: 180px;
    white-space: normal;
}

#customer_orders_table > tbody > tr[data-order_id] > td.column-total,
#customer_orders_table > thead > tr > th.column-total {
    text-align: right;
}

#customer_orders_table > tbody > tr[data-order_id] > td.column-actions,
#customer_orders_table > thead > tr > th.column-actions {
    width: 1%;
    padding-right: 0;
}

#customer_orders_table .column-actions .dropbtn {
    width: 28px;
    height: 28px;
    font-size: 24px;
    line-height: 28px;
    background: transparent;
}

/* Same width whatever's inside: order numbers, and sol-delivery's stop # / vehicle */
#customer_orders_table .sol-table-button {
    min-width: 84px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

#customer_orders_table .delivery-vehicle {
    font-weight: 600;
}

/* Order History: rows expand to show their items (openOrderItems in edit-customer.js) */
#customer_orders_table > tbody > tr[data-order_id] > td:not(.column-actions) {
    cursor: pointer;
}

#customer_orders_table > tbody > tr.opened > td {
    background-color: #f0f6fc;
}

#customer_orders_table > tbody > tr.is-loading > td {
    cursor: progress;
}

/* Absolutely positioned in the gap after the order button, so showing it never changes the cell's
   (or the table's) width and the columns don't jump while the items load. */
#customer_orders_table > tbody > tr.is-loading > td.column-order {
    position: relative;
}

#customer_orders_table > tbody > tr.is-loading > td.column-order::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -4px;
    width: 12px;
    height: 12px;
    margin-top: -7px;
    box-sizing: content-box;
    border: 2px solid #c3c4c7;
    border-top-color: var(--wp-admin-theme-color, #2271b1);
    border-radius: 50%;
    animation: sol-order-items-spin .7s linear infinite;
}

@keyframes sol-order-items-spin {
    to { transform: rotate(360deg); }
}

#customer_orders_table > tbody > tr.order_details > td.order-items-cell {
    padding: 0 12px 14px;
    background-color: #f0f6fc;
}

#customer_orders_table .order-items-table {
    table-layout: auto;
    border-color: #c5d9ed;
}

#customer_orders_table .order-items-table th,
#customer_orders_table .order-items-table td {
    padding: 7px 10px;
    vertical-align: middle;
}

#customer_orders_table .order-items-table .num {
    text-align: right;
    white-space: nowrap;
}

#customer_orders_table .order-items-table td.item-actions {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

/* Re-order and Refund: one row, same size */
#customer_orders_table .order-items-table td.item-actions .button {
    min-width: 80px;
    min-height: 32px;
    margin: 0 0 0 6px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 30px;
    text-align: center;
}

/* Keep the button's own border on hover (the #customer_orders .button:hover rule below
   inherits the cell's, which drops the edge) */
#edit_customer #customer_orders .order-items-table td.item-actions .button:hover {
    background: #f0f0f1;
    border-color: currentColor;
}

/* Notices that say what an update did (sol_toast / updated() in edit-customer.js) */
.sol-toasts {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
    pointer-events: none;
}

.sol-toast {
    padding: 12px 16px;
    background: #1d2327;
    color: #fff;
    border-left: 4px solid #00a32a;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-line;
}

.sol-toast.is-fail {
    border-left-color: #d63638;
}

#customer_orders_table .order-items-table tfoot th {
    font-weight: 700;
    background-color: #f6f7f7;
}

/* Product thumbnail beside the name in an expanded order's item rows */
#customer_orders_table .order-items-table .order-items-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

#customer_orders_table .order-items-table .order-items-label .order-item-thumb {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
}

#customer_orders_table .order-items-table .order-item-field {
    margin-top: 2px;
    font-size: 12px;
    color: #50575e;
}

/* Order History: items matching the product search inside an expanded order */
#customer_orders_table tr.is-search-match > td {
    background-color: #fcf3d0 !important;
}

#customer_orders_table tr.is-search-match .kf_label {
    font-weight: 700;
}

#edit_customer .sol-toolbar-stats {
    display: flex;
    gap: 28px;
    margin-left: auto;
    padding: 0 20px 5px 10px;
}

#edit_customer .sol-toolbar-stat__label {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #50575e;
}

#edit_customer .sol-toolbar-stat__value {
    display: block;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: #1d2327;
}

.cal_page_edit-customer #ui-datepicker-div {
    z-index: 101 !important;
}

/* Orders is usually taller than the viewport and the other tabs usually aren't,
   so the page scrollbar came and went on every tab switch and shifted the
   layout. Always reserve its space on this screen. The SOL custom admin
   scrolls #wpbody rather than the window (custom-admin.css). */
.cal-admin.sol_page_edit-customer #wpbody {
    scrollbar-gutter: stable;
}

/* The 25em of bottom padding that used to sit here (e869201) kept dropdowns
   from being clipped by this container's overflow, but everything that opens
   from the order list (select2, datepicker, tooltips, drag helper) is
   attached to <body>, so it only made the Orders tab always scroll. */
#edit_customer .scroll-container {
    overflow-x: scroll;
    padding-bottom: 2em;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;
}

#edit_customer .scroll-container::-webkit-scrollbar {
    display: none;
}

#edit_customer #customer_orders .button:hover {
    background: inherit;
    border-color: inherit;
}

#edit_customer #customer_orders > table {
    min-width: 700px;
}

@media screen and (max-width: 600px) {
    #edit_customer .account-details-wrapper {
        top: 0px;
        padding-top: 10px;
    }
}

.ui-datepicker-inline.ui-datepicker {
    padding-bottom: 0.4em;
}
.ui-datepicker-inline.ui-datepicker .ui-datepicker-next span {
    left: 0;
}
.multidatespicker .ui-datepicker-inline .ui-datepicker-calendar td.ui-datepicker-current-day {
    background-color: transparent !important;
}
.multidatespicker .ui-datepicker-inline .ui-datepicker-calendar td.ui-datepicker-today:not(.ui-state-highlight) {
    background-color: rgba(0, 116, 210, 0.3) !important;
}
.multidatespicker .ui-datepicker-inline .ui-datepicker-calendar td.ui-state-highlight {
    background-color: rgba(0, 128, 0, 0.6) !important;
}
.multidatespicker .ui-datepicker-inline .ui-datepicker-calendar td.ui-datepicker-current-day a {
    color: inherit;
}
.multidatespicker .ui-datepicker-inline .ui-datepicker-calendar td.ui-state-highlight a {
    color: white;
}

.report-table, table.widefat.report-table {
    margin-bottom: 32px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.report-table td {
    border-bottom: 1px solid #e2e4e7;
}

.report-table th {
    font-weight: bold;
    padding: 16px 10px;
}

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

.report-table tr.sub-row td:first-child {
    padding-left: 3em;
}

.report-table tr.total-row td {
    font-weight: bold;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.report-grid-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.report-grid-item-data {
    display: table;
    width: 100%;
}
.report-grid-item-data > div {
    display: table-row;
}
.report-grid-item-data > div > div {
    display: table-cell;
}

.report-grid-item-header {
    font-size: 14px;
    padding: 8px 10px 4px 10px;
}

.report-grid-item-values {
    font-size: 14px;
    font-weight: bold;
}

.report-grid-item-value-labels {
    color: #888;
}

.report-grid-item-value-labels > div {
    padding: 0 10px 8px 10px;
}

.report-grid-item-values div {
    padding: 4px 10px;
}

/* google map hover label for AdvancedMarkerElement */
.polygon-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    display: none; /* Hidden by default */
    pointer-events: none;
}

/* make google map drawing buttong larger  */
div[class="gmnoprint"] div button {
    padding: 20px !important;
}

/* Modal dialogs (SOL\View\Modal, js/sol-modal.js). admin.css also loads on the frontend. */
.sol-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100050;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

body.sol-modal-open {
    overflow: hidden;
}

.sol-modal-dialog {
    background: #fff;
    width: min(800px, 92vw);
    max-width: 92vw;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sol-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #dcdcde;
    flex-shrink: 0;
}

.sol-modal-header h2 {
    margin: 0;
    font-size: 1.3em;
}

.sol-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #646970;
    padding: 0 5px;
}

.sol-modal-close:hover {
    color: #135e96;
}

.sol-modal-body {
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.sol-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid #dcdcde;
    background: #f6f7f7;
    flex-shrink: 0;
}

.sol-modal-footer__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.sol-modal-footer .spinner {
    float: none;
    margin: 0;
}

.sol-modal-message {
    margin: 12px 0 0;
}

.sol-modal-message:empty {
    display: none;
}

.sol-modal-message.error {
    padding: 8px 12px;
    border-left: 4px solid #d63638;
    background: #fcf0f1;
    color: #8a2424;
}

.sol-modal-message.success {
    padding: 8px 12px;
    border-left: 4px solid #00a32a;
    background: #edfaef;
    color: #135e1f;
}

/* Edit Customer / Email Customer modals: the <form> wraps body + footer, so it carries the dialog's flex column */
#update_account_details,
#admin_email_customer_form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

/* Fills the full-screen dialog on mobile so the footer sits at the bottom */
#update_account_details .sol-modal-body,
#admin_email_customer_form .sol-modal-body {
    flex: 1 1 auto;
}

#edit_customer_details_overlay .sol-form-grid,
#admin_email_customer_overlay .sol-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

#edit_customer_details_overlay .sol-form-field,
#admin_email_customer_overlay .sol-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

#edit_customer_details_overlay .sol-form-field--full,
#admin_email_customer_overlay .sol-form-field--full {
    grid-column: 1 / -1;
}

#edit_customer_details_overlay .sol-form-field label,
#admin_email_customer_overlay .sol-form-field label {
    font-weight: 600;
    color: #1d2327;
}

/* Email Customer modal */
/* Lets a long To/From address ellipsize instead of widening its grid column */
#admin_email_customer_overlay .sol-form-field {
    min-width: 0;
}

#admin_email_customer_overlay .sol-form-field input[type="text"],
#admin_email_customer_overlay .sol-form-field select {
    width: 100%;
    max-width: none;
    height: 38px;
    min-height: 38px;
    margin: 0;
    border-radius: 4px;
    box-sizing: border-box;
}

#admin_email_customer_overlay .sol-form-field input[type="text"] {
    padding: 4px 12px;
}

#admin_email_customer_overlay .sol-form-field select {
    padding: 0 32px 0 12px;
    line-height: 36px;
}

/* Read-only recipient */
#admin_email_customer_overlay #admin_email_to {
    border-color: #dcdcde;
    background: #f6f7f7;
    color: #1d2327;
    text-overflow: ellipsis;
    box-shadow: none;
    cursor: default;
}

#admin_email_customer_overlay .select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}

#admin_email_customer_overlay .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
    padding-right: 32px;
    color: #1d2327;
}

#admin_email_customer_overlay .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    width: 30px;
    right: 4px;
}

/* TinyMCE sizes its panel 100% plus its border; keep it flush with the fields above */
#admin_email_customer_overlay .mce-tinymce {
    box-sizing: border-box;
    border-color: #8c8f94;
    border-radius: 4px;
    overflow: hidden;
}

#admin_email_customer_overlay .sol-modal-footer .button {
    min-height: 36px;
    padding: 0 16px;
}

/* One line of text beside the buttons, so showing a result never changes the footer's height */
#admin_email_customer_overlay .sol-modal-status {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600;
}

#admin_email_customer_overlay .sol-modal-status.success {
    color: #007017;
}

#admin_email_customer_overlay .sol-modal-status.error {
    color: #b32d2e;
}

#admin_email_customer_overlay .sol-modal-status.success::before,
#admin_email_customer_overlay .sol-modal-status.error::before {
    font: normal 20px/1 dashicons;
    vertical-align: -5px;
    margin-right: 4px;
}

#admin_email_customer_overlay .sol-modal-status.success::before {
    content: "\f12a"; /* dashicons-yes-alt */
}

#admin_email_customer_overlay .sol-modal-status.error::before {
    content: "\f534"; /* dashicons-warning */
}

#edit_customer_details_overlay .sol-form-field .description {
    color: #3c434a;
    font-size: 12px;
}

/* Password: set one directly, or email the customer a reset link */
#edit_customer_details_overlay .sol-password-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

#edit_customer_details_overlay .sol-password-row input {
    flex: 1 1 220px;
    width: auto;
}

#edit_customer_details_overlay .sol-password-or {
    color: #3c434a;
    font-style: italic;
}

/* Icon buttons in the modal (reset link, delete) */
#edit_customer_details_overlay .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
}

#edit_customer_details_overlay .button .dashicons,
#edit_customer_details_overlay .button .dashicons::before {
    font-size: 17px;
    width: 17px;
    height: 17px;
    line-height: 1;
}

#edit_customer_details_overlay .sol-button-danger {
    color: #b32d2e;
    border-color: #b32d2e;
    background: #fff;
}

#edit_customer_details_overlay .sol-button-danger:hover,
#edit_customer_details_overlay .sol-button-danger:focus {
    color: #fff;
    border-color: #8a2424;
    background: #b32d2e;
}

#edit_customer_details_overlay .sol-button-danger:focus {
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #b32d2e;
}

#edit_customer_details_overlay .sol-form-field input {
    width: 100%;
    max-width: none;
    min-height: 36px;
    padding: 4px 10px;
    border-radius: 4px;
    box-sizing: border-box;
}

#edit_customer table.customer_products td {
    vertical-align: middle;
    font-size:0.9em;
}

@media screen and (max-width: 767px) {
    .sol-modal-overlay {
        padding: 0;
    }

    .sol-modal-dialog {
        width: 100vw;
        max-width: 100vw;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    #admin_email_customer_overlay .sol-modal-footer .button {
        min-height: 44px;
    }

    #admin_email_customer_form .wp-editor-wrap,
    #admin_email_customer_form .wp-editor-container,
    #admin_email_customer_form .mce-tinymce {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #admin_email_customer_form .mce-toolbar-grp .mce-container-body {
        flex-wrap: wrap !important;
    }

    #email_vendor_form textarea,
    #email_vendor_form input[type="text"],
    #email_vendor_form select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #email_vendor_form .form-table th,
    #email_vendor_form .form-table td {
        display: block;
        width: 100%;
    }

    #email_vendor_form .form-table th {
        padding-bottom: 4px;
    }

    #email_vendor_form .wp-editor-wrap,
    #email_vendor_form .wp-editor-container,
    #email_vendor_form .mce-tinymce {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #email_vendor_form .mce-toolbar-grp .mce-container-body {
        flex-wrap: wrap !important;
    }
}

/* Page Journey modal */
.sol-modal-dialog-narrow {
    width: min(560px, 92vw);
}

.sol-modal-dialog-wide {
    width: min(960px, 92vw);
}

.sol-modal-dialog-full {
    width: 96vw;
    max-width: 96vw;
    height: 94vh;
    max-height: 94vh;
}

.sol-journey-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    counter-reset: journey-step;
}

.sol-journey-list li {
    counter-increment: journey-step;
    position: relative;
    padding: 0 0 18px 34px;
    margin: 0;
}

.sol-journey-list li::before {
    content: counter(journey-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border-radius: 50%;
}

.sol-journey-list li::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 24px;
    bottom: -2px;
    width: 2px;
    background: #dcdcde;
}

.sol-journey-list li:last-child::after {
    display: none;
}

.sol-journey-list li:last-child::before {
    background: #2d5016;
}

.sol-journey-list a {
    display: inline-block;
    word-break: break-all;
    line-height: 1.4;
}

/* Styling for admin email result messages */
.admin-email-result-message {
    padding: 10px 12px;
    border-radius: 3px;
    display: none;
}

.admin-email-result-message.success {
    display: block;
    background-color: #c6e1b6;
    border: 1px solid #7ad03d;
    color: #2d5016;
}

.admin-email-result-message.error {
    display: block;
    background-color: #ffebe8;
    border: 1px solid #c00;
    color: #810000;
}

/* ==========================================================================
   Edit Customer — responsive
   The screen was authored desktop-only. Several fixed-width rules live in
   css/sol.css (loaded on the frontend too), so they are overridden here by
   ID-scoping under #edit_customer, which out-specifies the class selectors
   there. 782px matches WordPress's own admin breakpoint, so our layout
   switches at the same width WP collapses its admin menu.
   ========================================================================== */

@media screen and (max-width: 782px) {

    /* --- Customer header cards ------------------------------------------
       Name card takes its own row; email / phone / balance share the next. */
    #edit_customer .account-details-wrapper {
        top: 0;
        padding-top: 10px;
    }

    #edit_customer .sol-customer-header {
        grid-template-columns: 1.4fr 1fr 1fr;
    }

    #edit_customer .sol-customer-card--name {
        grid-column: 1 / -1;
        border-top-right-radius: 7px;
    }

    #edit_customer .sol-customer-card {
        padding: 8px 12px;
    }

    /* Second row: divider above, none on the cell that starts the row */
    #edit_customer .sol-customer-card + .sol-customer-card {
        border-top: 1px solid var(--sol-header-divider);
    }

    #edit_customer .sol-customer-card--name + .sol-customer-card {
        border-left: 0;
    }

    #edit_customer .sol-customer-card:last-child {
        border-top-right-radius: 0;
    }

    #edit_customer .sol-customer-card--name h2.customer-label {
        font-size: 19px;
    }

    #edit_customer .sol-customer-card__value {
        font-size: 15px;
    }

    /* Touch-sized icon buttons */
    #edit_customer .sol-customer-card__action {
        right: 8px;
        width: 40px;
        height: 40px;
        margin-top: -20px;
    }

    #edit_customer .sol-customer-card:has(.sol-customer-card__action) {
        padding-right: 56px;
    }

    /* 16px stops iOS Safari zooming in on focus */
    #edit_customer_details_overlay .sol-form-field input {
        font-size: 16px;
        min-height: 44px;
    }

    /* --- Tab strip ------------------------------------------------------
       11 tabs wrap to 3 rows at this width. Collapse to one scrolling row. */
    #edit_customer .nav-tab-wrapper {
        flex-wrap: nowrap;
        gap: 4px 9px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        margin: 0 0 8px;
    }

    #edit_customer .nav-tab-wrapper .nav-tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
        padding: 11px 13px 7px;
        font-size: 14px;
    }

    #edit_customer .nav-tab-wrapper .nav-tab + .nav-tab::before {
        left: -5px;
        height: 18px;
        margin-top: -9px;
    }

    /* Keep the horizontal overflow discoverable. */
    #edit_customer .nav-tab-wrapper::-webkit-scrollbar {
        height: 4px;
    }

    #edit_customer .nav-tab-wrapper::-webkit-scrollbar-thumb {
        background: #c3c4c7;
        border-radius: 2px;
    }

    /* --- Order list container -------------------------------------------
       admin.css:481 pins this to 960px inside .scroll-container, whose
       scrollbar is hidden — content was cut off with no way to know. */
    #edit_customer #delivery_container_parent {
        min-width: 0;
    }

    #edit_customer .scroll-container {
        overflow-x: auto;
        padding-bottom: 4em;    /* 25em of dead space is huge on a phone */
        -ms-overflow-style: auto;
        scrollbar-width: thin;
    }

    #edit_customer .scroll-container::-webkit-scrollbar {
        display: block;
        height: 6px;
    }

    #edit_customer .scroll-container::-webkit-scrollbar-thumb {
        background: #c3c4c7;
        border-radius: 3px;
    }

    /* --- Tab toolbars ----------------------------------------------------
       fulfillment.css hides every .fulfillment-header under 768px, because the Fulfillment
       report page puts its filters behind a toggle there. The edit-customer tabs have no
       toggle: their toolbar (Add Item, address picker, notes form, search...) is the main
       control, so without this it vanished on phones. Same selector weight as the rules below. */
    #edit_customer .fulfillment-page .fulfillment-header {
        display: block;
    }

    /* The toolbar stacks to 80-320px tall here. Pinned under the sticky customer header it left
       about a quarter of a phone screen for the content, so let it scroll away. */
    #edit_customer .fulfillment-widget-container {
        position: static;
    }

    /* --- Filter row (Search Products / address / date) -------------------
       Overrides the 250px + 350px min-widths at admin.css:437-447. */
    #edit_customer .fulfillment-header .filter-container {
        flex-direction: column;
        align-items: stretch;
        margin-right: 0 !important;
    }

    /* Leave room for the 10px side margins; plain 100% overflowed the card */
    #edit_customer .fulfillment-header .filter-control {
        width: calc(100% - 20px);
        box-sizing: border-box;
        margin-bottom: 8px;
    }

    #edit_customer .fulfillment-header .product-control,
    #edit_customer .fulfillment-header .address-control,
    #edit_customer .fulfillment-header .custom-control {
        min-width: 0;
        max-width: none;
    }

    /* select2/selectWoo writes inline pixel widths, so !important is needed. */
    #edit_customer .fulfillment-header .select2-container {
        width: 100% !important;
    }

    #edit_customer .fulfillment-header textarea,
    #edit_customer .fulfillment-header .sol-toolbar-search,
    #edit_customer .fulfillment-header .sol-toolbar select {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    #edit_customer .sol-toolbar-stats {
        margin-left: 0;
        padding: 4px 10px 10px;
    }

    /* Order History columns don't wrap; scroll the table rather than the page */
    #edit_customer #customer_orders {
        overflow-x: auto;
    }

    #edit_customer .fulfillment-header .select2-container .select2-selection--single {
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    /* Inline height:38px on this input (LegacyCustomer.php:1423) beats a
       min-height, so set height directly to reach a 40px touch target. */
    #edit_customer .fulfillment-header input#delivery_date {
        width: 100%;
        box-sizing: border-box;
        height: 40px !important;
        font-size: 16px;
    }

    /* --- Order card header ----------------------------------------------
       Stacks the desktop flex row so the delivery address isn't clipped. */
    #edit_customer #delivery_container_parent .delivery-container .order-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        text-align: left;
    }

    #edit_customer #delivery_container_parent .order-header-order {
        margin-left: 0;
        text-align: left;
    }

    #edit_customer #delivery_container_parent .order-header-order-info {
        justify-content: flex-start;
    }

    #edit_customer .order-header-name,
    #edit_customer .order-header-address,
    #edit_customer .order-header-order,
    #edit_customer .order-header-item {
        font-size: 1em;
    }

    /* Name and address read first; controls sit together below. */
    #edit_customer .order-header-name { order: 1; }
    #edit_customer .order-header-address { order: 2; }
    #edit_customer .order-header-item { order: 3; }
    #edit_customer .order-header-order { order: 3; }
    #edit_customer .order-header-date { order: 4; }
    #edit_customer .order-header-actions { order: 5; }

    #edit_customer .order-header-date input.date-picker {
        width: 100%;
        box-sizing: border-box;
        min-height: 40px;
        font-size: 16px;
    }

    /* Hover-reveal map is unreachable on touch. */
    #edit_customer .order-header-address .hover_map_container {
        display: none !important;
    }

    /* --- Line-item table -------------------------------------------------
       Kept as a real table (JS reads these inputs by class); each card
       scrolls on its own so column alignment survives. */
    #edit_customer .delivery-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    #edit_customer .delivery-container::-webkit-scrollbar {
        height: 6px;
    }

    #edit_customer .delivery-container::-webkit-scrollbar-thumb {
        background: #c3c4c7;
        border-radius: 3px;
    }

    #edit_customer table.customer_products {
        min-width: 640px;
    }

    /* 16px prevents iOS Safari auto-zoom when these are focused. */
    #edit_customer table.customer_products input.kf_qty,
    #edit_customer table.customer_products input.kf_price,
    #edit_customer table.customer_products input.kf_discount,
    #edit_customer table.customer_products input.kf_expires,
    #edit_customer table.customer_products input.kf_delivery_date,
    #edit_customer table.customer_products select.kf_frequency {
        font-size: 16px;
        min-height: 36px;
    }

    /* Row action icons become tappable. */
    #edit_customer table.customer_products td .dashicons {
        font-size: 22px;
        width: 32px;
        height: 32px;
        line-height: 32px;
        text-align: center;
    }

    /* --- Totals footer ---------------------------------------------------
       .box-header-parent is row-nowrap (sol.css:879); with 6 children the
       fees/shipping labels crush together. Wrap them 2-up instead. */
    #edit_customer .box-header-parent {
        flex-flow: row wrap;
        justify-content: flex-start !important;
        gap: 10px 12px;
    }

    /* Children carry inline word-wrap:unset (Order.php:516+), a legacy alias
       of overflow-wrap — so !important is required to let labels such as
       "Delivery Fee - Oak Harbor" wrap instead of forcing the row wider. */
    #edit_customer .box-header-child {
        flex: 1 1 45%;
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
        overflow-wrap: anywhere !important;
    }

    #edit_customer .box-header-child p {
        margin: 2px 0 0;
    }

    /* Bigger tap targets for the row action buttons */
    #edit_customer #delivery_container_parent table.customer_products td.order-item-actions .dashicons {
        width: 22px;
        height: 22px;
        padding: 6px;
        font-size: 22px;
        line-height: 22px;
    }

    /* Order totals stack one per line with the value beside its label, all
       left-aligned so they stay visible while the table scrolls sideways. */
    #edit_customer #delivery_container_parent .order-totals-item {
        flex: 1 1 100%;
        display: flex;
        align-items: baseline;
        gap: 10px;
        padding: 8px 12px;
        border-right: 0;
        border-bottom: 1px solid #e2e4e7;
    }

    #edit_customer #delivery_container_parent .order-totals-label {
        flex: 0 0 80px;
        margin-bottom: 0;
    }

    #edit_customer #delivery_container_parent .order-totals-subtotal {
        margin-left: 0;
        border-left: 0;
    }

    #edit_customer #delivery_container_parent .order-totals-grand {
        border-bottom: 0;
        border-bottom-left-radius: 7px;
    }
}

/* Tightest tier — single-column summary bar. */
@media screen and (max-width: 480px) {

    /* Name and email get full rows; phone + balance pair up to keep the sticky header short */
    #edit_customer .sol-customer-header {
        grid-template-columns: 1fr 1fr;
    }

    #edit_customer .sol-customer-card:has(.customer-email-value) {
        grid-column: 1 / -1;
    }

    /* Phone starts the third row */
    #edit_customer .sol-customer-card:has(.customer-email-value) + .sol-customer-card {
        border-left: 0;
    }

    #edit_customer_details_overlay .sol-form-grid,
    #admin_email_customer_overlay .sol-form-grid {
        grid-template-columns: 1fr;
    }

    /* Password: input, "or", then the reset-link button, each on its own line */
    #edit_customer_details_overlay .sol-password-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    #edit_customer_details_overlay .sol-password-row input {
        flex: 0 0 auto;
        width: 100%;
    }

    #edit_customer_details_overlay .sol-password-or {
        text-align: center;
    }

    #edit_customer_details_overlay .sol-password-row .button {
        justify-content: center;
        min-height: 44px;
    }

    /* Footer: Cancel/Save share the top row; Delete gets its own row below */
    #update_account_details .sol-modal-footer {
        flex-wrap: wrap;
    }

    #update_account_details .sol-modal-footer__actions {
        order: 1;
        width: 100%;
    }

    #update_account_details .sol-modal-footer__actions .button {
        flex: 1 1 0;
        justify-content: center;
        min-height: 44px;
    }

    #update_account_details #delete_customer {
        order: 2;
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    #edit_customer .box-header-child {
        flex-basis: 100%;
    }
}

/* Product drag-and-drop between orders (edit-customer.js makeDraggable/makeDroppable) */

/* The original row, while a drag is in progress */
#delivery_container_parent tbody tr.kf-row-dragging {
    background-color: #fff8c5 !important;
    outline: 2px dashed #d9a300;
    outline-offset: -2px;
}

/* The floating helper clone that follows the cursor */
table.customer_products.drag-helper {
    background-color: #fff8c5;
    border: 2px solid #d9a300;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    opacity: 0.95;
}

table.customer_products.drag-helper tbody tr {
    background-color: #fff8c5 !important;
}

/* Order tables that are valid drop targets while a row is being dragged */
#delivery_container_parent .customer_products.kf-drop-target {
    outline: 2px dashed #2271b1;
    outline-offset: -2px;
    background-color: #eaf2fa;
}

/* Stronger highlight when hovering directly over a valid drop target */
#delivery_container_parent .customer_products.kf-drop-target.kf-drop-target-hover {
    outline: 2px solid #2271b1;
    background-color: #d3e6f7;
}


/* Notification preferences on the edit-customer address panel
   (Address::render_notification_prefs_section, edit-customer.js renderNotificationRecipients) */

.sol-notif-card {
    margin-bottom: 12px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.sol-notif-card__header {
    padding: 10px 14px;
    border-bottom: 1px solid #dcdcde;
    background: #f6f7f7;
}

.sol-notif-card__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #1d2327;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sol-notif-card__toggle input {
    margin: 0;
}

.sol-notif-card__body {
    padding: 12px 14px;
}

/* Disabled notification: dim the recipients so it reads as inactive */
.sol-notif-card:has(.sol-notif-card__toggle input:not(:checked)) .sol-notif-card__body {
    opacity: 0.55;
}

.sol-notif-card__label {
    margin-bottom: 4px;
    color: #646970;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* The container is emitted with no whitespace so :empty matches when there are no recipients */
.sol-notif-card__body > div[data-type]:empty::before {
    content: "No additional recipients";
    display: block;
    padding: 6px 0 10px;
    color: #8c8f94;
    font-size: 13px;
    font-style: italic;
}

ul.notification-recipients {
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.notification-recipient {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.notification-recipient:last-child {
    border-bottom: 0;
}

.notification-recipient__icon {
    display: flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f6fc;
    color: #2271b1;
}

.notification-recipient__icon .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.notification-recipient__info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.notification-recipient__name {
    color: #1d2327;
    font-weight: 600;
}

.notification-recipient__email {
    color: #646970;
    font-size: 13px;
}

/* With no name, the email is the primary line */
.notification-recipient__info > .notification-recipient__email:only-child {
    color: #1d2327;
    font-size: inherit;
}

.notification-recipient .remove-notification-recipient {
    flex: 0 0 auto;
    color: #b32d2e;
    font-size: 12px;
    text-decoration: none;
}

.notification-recipient .remove-notification-recipient:hover,
.notification-recipient .remove-notification-recipient:focus {
    color: #8a2424;
    text-decoration: underline;
}

/* Narrow address-editor column: drop the icon and put Remove under the email so it isn't squeezed */
.edit-address-column--notifications {
    container: sol-notif / inline-size;
}

@container sol-notif (max-width: 260px) {
    .notification-recipient {
        flex-wrap: wrap;
        gap: 2px 10px;
    }

    .notification-recipient__icon {
        display: none;
    }

    .notification-recipient__info {
        flex-basis: 100%;
    }
}

.add-notification-recipient {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    color: #2271b1;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.add-notification-recipient .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
}

.add-notification-recipient:hover,
.add-notification-recipient:focus {
    border-color: #2271b1;
    background: #f0f6fc;
    color: #135e96;
}

/* "Add recipient" modal form. It lives outside the notification cards, so don't scope these to them. */
.notification-recipient-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    height: 100%;
    padding-top: 8px;
}

.notification-recipient-field {
    display: block;
}

.notification-recipient-field span {
    display: block;
    margin-bottom: 4px;
    color: #1d2327;
    font-weight: 600;
}

.notification-recipient-field input {
    box-sizing: border-box;
    width: 100%;
}

.notification-recipient-container__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
}

.notification-recipient-container__actions .spinner {
    float: none;
    margin: 0;
}

/* Merge Customer (SOL\CustomerMerge, admin/js/customer-merge.js) */
#open_merge_customer .dashicons {
    flex: none;
    color: inherit;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

#merge_customer_overlay .sol-modal-dialog {
    width: min(560px, 92vw);
}

#merge_customer_overlay .sol-modal-body {
    font-size: 1rem;
    line-height: 1.5;
}

#merge_customer_overlay .sol-merge-intro {
    margin: 0 0 16px;
    font-size: 1rem;
}

#merge_customer_overlay .sol-merge-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 1rem;
}

#merge_customer_overlay .select2-container .select2-selection--single {
    height: 40px;
    font-size: 1.05rem;
}

#merge_customer_overlay .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
}

#merge_customer_overlay .select2-container .select2-selection--single .select2-selection__arrow {
    height: 38px;
}

#merge_customer_overlay .select2-search__field {
    font-size: 1rem;
}

#merge_customer_overlay .select2-results__option {
    font-size: 1rem;
}

.sol-merge-result {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

.sol-merge-result__name {
    font-weight: 600;
}

.sol-merge-result__status {
    font-size: 0.85rem;
    padding: 0 6px;
    border-radius: 3px;
    background: #f0f0f1;
    color: #50575e;
}

.sol-merge-result__status.is-active {
    background: #edfaef;
    color: #135e1f;
}

.select2-results__option--highlighted .sol-merge-result__status {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.sol-merge-result__details {
    flex-basis: 100%;
    font-size: 0.9rem;
    opacity: 0.8;
}

#merge_customer_overlay .sol-merge-preview:not(:empty) {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #f6f7f7;
}

#merge_customer_overlay .sol-merge-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #50575e;
}

#merge_customer_overlay .sol-merge-loading .spinner {
    float: none;
    margin: 0;
}

#merge_customer_overlay .sol-merge-target {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

#merge_customer_overlay .sol-merge-target a {
    font-weight: 600;
}

#merge_customer_overlay .sol-merge-target__label {
    font-weight: 600;
    color: #50575e;
}

#merge_customer_overlay .sol-merge-target__meta {
    flex-basis: 100%;
    font-size: 0.9rem;
    color: #50575e;
}

#merge_customer_overlay .sol-merge-heading {
    margin: 14px 0 6px;
    font-size: 1rem;
}

#merge_customer_overlay .sol-merge-counts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 4px 16px;
    margin: 0;
}

#merge_customer_overlay .sol-merge-counts li {
    margin: 0;
}

#merge_customer_overlay .sol-merge-count {
    display: inline-block;
    min-width: 1.4em;
    font-weight: 600;
    text-align: right;
}

#merge_customer_overlay .sol-merge-note {
    color: #50575e;
    font-size: 0.9rem;
}

#merge_customer_overlay .sol-merge-empty {
    margin: 0;
    color: #50575e;
}

#merge_customer_overlay .sol-merge-notes {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid #dcdcde;
}

#merge_customer_overlay .sol-merge-notes li {
    margin: 0 0 4px;
}

#merge_customer_overlay .sol-merge-confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

#merge_customer_overlay .sol-modal-footer__actions {
    min-width: 0;
}

/* Long customer names: keep the button on one line */
#merge_customer_overlay #merge_customer_submit {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#merge_customer_overlay .sol-merge-confirm[hidden] {
    display: none;
}

#merge_customer_overlay .sol-modal-footer .button {
    min-height: 36px;
    font-size: 1.05rem;
}

#merge_customer_overlay .sol-button-danger {
    color: #b32d2e;
    border-color: #b32d2e;
    background: #fff;
}

#merge_customer_overlay .sol-button-danger:not(:disabled):hover,
#merge_customer_overlay .sol-button-danger:not(:disabled):focus {
    color: #fff;
    border-color: #8a2424;
    background: #b32d2e;
}

#merge_customer_overlay .sol-button-danger:disabled {
    color: #a7aaad !important;
    border-color: #dcdcde !important;
    background: #f6f7f7 !important;
}
