/**
 * AgenWebsite Shipping - Pengiriman Massal (bulk Generate Resi)
 *
 * Builds on fulfillment-orders.css (loaded first): --aw-* tokens, .aw-modal,
 * .aw-modal-container, .aw-modal-header/-body/-footer, .aw-btn, .aw-section.
 */

/* Elements toggled with the hidden attribute must win over display rules */
#aw-bulk-modal [hidden],
#aw-bulk-select-modal [hidden],
.aw-bulk-ship-trigger [hidden] {
    display: none !important;
}

/* ========================================
   Entry button (page title row, right side)
   Core .button.button-primary - the same family as the "Generate Resi"
   buttons in the list - so it follows the admin color scheme; sized like
   the "Add order" .page-title-action next to the title.
   ======================================== */
.wrap .button.aw-bulk-ship-trigger {
    float: right;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    margin: 0 0 0 8px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 30px;
}

.wrap .button.aw-bulk-ship-trigger.is-loading {
    opacity: 0.75;
    cursor: progress;
}

.aw-bulk-ship-trigger-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #fff;
    color: var(--wp-admin-theme-color, #2271b1);
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    animation: awBulkPop 0.25s ease;
}

.wp-list-table .check-column.aw-bulk-pulse {
    animation: awBulkPulse 0.6s ease 3;
}

@keyframes awBulkPulse {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(0, 115, 170, 0); background: transparent; }
    50% { box-shadow: inset 0 0 0 2px var(--aw-primary); background: var(--aw-primary-light); }
}

@keyframes awBulkPop {
    0% { transform: scale(0.6); opacity: 0; }
    70% { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   Overlay (own class - see bulk-shipping-modal.php)
   ======================================== */
.aw-bulk-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ========================================
   "Pilih pesanan dulu" notice
   ======================================== */
.aw-bulk-select-body {
    padding: 28px 28px 8px;
    text-align: center;
}

.aw-bulk-select-body h3 {
    margin: 18px 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--aw-gray-900);
}

.aw-bulk-select-body p {
    margin: 0;
    color: var(--aw-gray-600);
    font-size: 13px;
    line-height: 1.6;
}

.aw-bulk-select-illustration {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: var(--aw-primary-light);
    border-radius: var(--aw-radius-lg);
}

.aw-bulk-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aw-bulk-select-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid var(--aw-gray-400);
    background: #fff;
    position: relative;
}

.aw-bulk-select-box.is-checked {
    border-color: var(--aw-primary);
    background: var(--aw-primary);
    animation: awBulkTick 1.8s ease infinite;
}

.aw-bulk-select-box.is-checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.aw-bulk-select-row:nth-child(3) .aw-bulk-select-box.is-checked {
    animation-delay: 0.3s;
}

.aw-bulk-select-line {
    width: 110px;
    height: 8px;
    border-radius: 4px;
    background: #c7dfeb;
}

.aw-bulk-select-line.is-short {
    width: 70px;
}

@keyframes awBulkTick {
    0%, 60%, 100% { transform: scale(1); }
    30% { transform: scale(1.2); }
}

.aw-bulk-select-footer {
    justify-content: center;
    border-top: none;
    padding-bottom: 22px;
}

/* ========================================
   Modal shell
   ======================================== */
.aw-bulk-container {
    height: calc(100vh - 40px);
    max-height: 860px;
}

.aw-bulk-header {
    gap: 16px;
}

.aw-bulk-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.aw-bulk-header-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--aw-primary);
    color: #fff;
}

#aw-bulk-modal[data-view="process"] .aw-bulk-header-icon .dashicons {
    animation: awBulkDrive 0.9s ease-in-out infinite;
}

@keyframes awBulkDrive {
    0%, 100% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
}

.aw-bulk-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: var(--aw-gray-500);
}

.aw-bulk-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.aw-bulk-steps li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--aw-gray-400);
}

.aw-bulk-steps li + li::before {
    content: '';
    width: 22px;
    height: 2px;
    margin-right: 2px;
    background: var(--aw-gray-200);
    border-radius: 2px;
}

.aw-bulk-steps li span {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--aw-gray-100);
    color: var(--aw-gray-500);
    font-size: 11px;
    transition: var(--aw-transition);
}

.aw-bulk-steps li.is-active {
    color: var(--aw-primary);
}

.aw-bulk-steps li.is-active span {
    background: var(--aw-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--aw-primary-light);
}

.aw-bulk-steps li.is-done {
    color: var(--aw-success);
}

.aw-bulk-steps li.is-done span {
    background: var(--aw-success);
    color: #fff;
}

.aw-bulk-steps li.is-done + li::before,
.aw-bulk-steps li.is-active + li::before {
    background: linear-gradient(90deg, var(--aw-success), var(--aw-gray-200));
}

.aw-bulk-dry-run {
    padding: 7px 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #92400e;
    background: repeating-linear-gradient(-45deg, #fef3c7, #fef3c7 12px, #fde68a 12px, #fde68a 24px);
    text-align: center;
}

.aw-bulk-body {
    padding: 16px;
}

.aw-bulk-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}

.aw-bulk-col-left,
.aw-bulk-col-right {
    min-width: 0;
}

.aw-bulk-col-right {
    position: sticky;
    top: 0;
}

.aw-bulk-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--aw-gray-500);
    line-height: 1.5;
}

.aw-bulk-muted {
    margin: 0;
    color: var(--aw-gray-400);
}

.aw-bulk-link {
    padding: 0;
    background: none;
    border: none;
    color: var(--aw-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.aw-bulk-link.is-danger {
    color: #dc2626;
}

.aw-bulk-spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--aw-gray-200);
    border-top-color: var(--aw-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* ========================================
   Summary list
   ======================================== */
.aw-bulk-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--aw-gray-100);
    margin-bottom: 10px;
}

.aw-bulk-summary-head .aw-section-title {
    border-bottom: none;
    margin-bottom: 8px;
    padding-bottom: 0;
}

.aw-bulk-counters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.aw-bulk-counter {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px 2px 4px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.aw-bulk-counter .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

.aw-bulk-counter.is-ok { background: var(--aw-success-light); color: #15803d; }
.aw-bulk-counter.is-red { background: var(--aw-danger-light); color: #dc2626; }
.aw-bulk-counter.is-blocked { background: var(--aw-gray-100); color: var(--aw-gray-500); }

.aw-bulk-review-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--aw-danger-light);
    border: 1px solid #fecaca;
    border-radius: var(--aw-radius);
    font-size: 12px;
    font-weight: 600;
    color: #b91c1c;
    animation: errorFadeIn 0.25s ease;
}

.aw-bulk-review-bar-actions {
    display: inline-flex;
    gap: 14px;
}

.aw-bulk-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aw-bulk-row {
    position: relative;
    display: flex;
    gap: 8px;
    padding: 8px 30px 8px 10px;
    background: #fff;
    border: 1px solid var(--aw-gray-200);
    border-left: 3px solid var(--aw-gray-200);
    border-radius: var(--aw-radius);
    transition: border-color 0.2s ease, background 0.2s ease, opacity 0.25s ease, transform 0.25s ease;
    animation: awBulkRowIn 0.25s ease both;
}

.aw-bulk-row.is-mismatch {
    padding-right: 10px;
}

@keyframes awBulkRowIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.aw-bulk-row.is-leaving {
    opacity: 0;
    transform: translateX(24px);
}

.aw-bulk-row.is-ok { border-left-color: var(--aw-success); }
.aw-bulk-row.is-confirmed { border-left-color: var(--aw-warning); }

.aw-bulk-row.is-mismatch {
    border-color: #fecaca;
    border-left-color: var(--aw-danger);
    background: #fffafa;
}

.aw-bulk-row.is-blocked,
.aw-bulk-row.is-error {
    background: var(--aw-gray-50);
    border-left-color: var(--aw-gray-300);
}

.aw-bulk-row.is-blocked .aw-bulk-row-head,
.aw-bulk-row.is-blocked .aw-bulk-row-note {
    color: var(--aw-gray-500);
}

.aw-bulk-row.is-error { border-left-color: #fca5a5; }

.aw-bulk-row-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--aw-gray-100);
    color: var(--aw-gray-500);
}

.aw-bulk-row-icon .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.aw-bulk-row.is-ok .aw-bulk-row-icon { background: var(--aw-success); color: #fff; animation: awBulkPop 0.3s ease; }
.aw-bulk-row.is-confirmed .aw-bulk-row-icon { background: var(--aw-warning); color: #fff; }
.aw-bulk-row.is-mismatch .aw-bulk-row-icon { background: var(--aw-danger); color: #fff; animation: awBulkPop 0.3s ease; }
.aw-bulk-row.is-error .aw-bulk-row-icon { background: #fee2e2; color: #dc2626; }
.aw-bulk-row.is-loading .aw-bulk-row-icon { background: transparent; }

.aw-bulk-row-main {
    flex: 1;
    min-width: 0;
}

.aw-bulk-row-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 6px;
    min-height: 20px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--aw-gray-800);
}

.aw-bulk-row-head strong {
    font-weight: 700;
}

.aw-bulk-row-name {
    font-weight: 500;
}

.aw-bulk-row-city::before,
.aw-bulk-row-meta::before {
    content: '·';
    margin-right: 6px;
    color: var(--aw-gray-300);
}

.aw-bulk-row-city,
.aw-bulk-row-meta {
    color: var(--aw-gray-500);
    font-size: 12px;
}

.aw-bulk-row-insured {
    display: inline-flex;
    color: #0e7490;
}

.aw-bulk-row-insured .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.aw-bulk-row-note {
    margin-top: 2px;
    font-size: 12px;
    color: var(--aw-gray-600);
}

.aw-bulk-row.is-error .aw-bulk-row-note {
    color: #b91c1c;
}

.aw-bulk-row-x {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--aw-gray-400);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    transition: var(--aw-transition);
}

.aw-bulk-row:hover .aw-bulk-row-x,
.aw-bulk-row-x:focus {
    opacity: 1;
}

.aw-bulk-row-x:hover {
    background: var(--aw-danger-light);
    color: #dc2626;
}

.aw-bulk-row-skeleton {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.aw-bulk-row-skeleton span {
    height: 18px;
    flex: 1;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--aw-gray-100) 25%, var(--aw-gray-200) 50%, var(--aw-gray-100) 75%);
    background-size: 200% 100%;
    animation: awBulkShimmer 1.2s ease-in-out infinite;
}

@keyframes awBulkShimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* Checkout vs Resi - one compact line */
.aw-bulk-compare {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px 8px;
    margin-top: 4px;
    font-size: 12px;
}

.aw-bulk-cmp {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
}

.aw-bulk-cmp-label {
    flex-shrink: 0;
    padding: 0 5px;
    border-radius: 3px;
    background: var(--aw-gray-100);
    color: var(--aw-gray-500);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 16px;
    text-transform: uppercase;
}

.aw-bulk-cmp.is-resi .aw-bulk-cmp-label {
    background: var(--aw-primary-light);
    color: var(--aw-primary);
}

.aw-bulk-cmp img {
    width: 24px;
    height: 14px;
    object-fit: contain;
    flex-shrink: 0;
}

.aw-bulk-cmp-service {
    color: var(--aw-gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aw-bulk-cmp-price {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--aw-gray-900);
}

.aw-bulk-cmp-price.is-up {
    color: #dc2626;
}

.aw-bulk-cmp-sub {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--aw-gray-500);
}

.aw-bulk-saving {
    flex-shrink: 0;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--aw-success-light);
    color: #15803d;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
}

.aw-bulk-cmp-arrow {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--aw-gray-300);
}

.aw-bulk-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.aw-bulk-reason {
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--aw-danger-light);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Info only (e.g. order status) - never makes the row red */
.aw-bulk-note {
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    background: var(--aw-warning-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.aw-bulk-row.is-confirmed .aw-bulk-reason {
    background: var(--aw-gray-100);
    color: var(--aw-gray-500);
    border-color: var(--aw-gray-200);
    text-decoration: line-through;
    text-decoration-color: var(--aw-gray-300);
}

.aw-bulk-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.aw-bulk-service-select {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 320px;
}

.aw-bulk-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
    border: 1px solid var(--aw-gray-300);
    background: #fff;
    color: var(--aw-gray-700);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--aw-transition);
}

.aw-bulk-chip-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

.aw-bulk-chip-btn:hover {
    border-color: var(--aw-gray-400);
    background: var(--aw-gray-50);
}

.aw-bulk-chip-btn.is-primary {
    background: var(--aw-primary);
    border-color: var(--aw-primary);
    color: #fff;
}

.aw-bulk-chip-btn.is-primary:hover {
    background: var(--aw-primary-hover);
}

.aw-bulk-chip-btn.is-danger {
    color: #dc2626;
    border-color: #fecaca;
}

.aw-bulk-chip-btn.is-danger:hover {
    background: var(--aw-danger-light);
}

.aw-bulk-confirmed-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
    background: var(--aw-warning-light);
    color: #92400e;
    font-size: 12px;
    font-weight: 700;
}

.aw-bulk-confirmed-badge .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

/* COD / Non-COD per order (integrators with a COD toggle, e.g. Everpro) */
.aw-bulk-cod-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid var(--aw-gray-300);
    background: #fff;
    color: var(--aw-gray-500);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    cursor: pointer;
    transition: var(--aw-transition);
}

.aw-bulk-cod-toggle:hover {
    border-color: var(--aw-gray-400);
    color: var(--aw-gray-700);
}

.aw-bulk-cod-toggle.is-cod {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.aw-bulk-cod-toggle.is-static {
    cursor: default;
}

.aw-bulk-cod-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--aw-gray-300);
}

.aw-bulk-cod-toggle.is-cod .aw-bulk-cod-dot {
    background: #10b981;
}

.aw-bulk-cashback {
    flex-shrink: 0;
    padding: 0 6px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
}

/* Per-order pickup date + time */
.aw-bulk-pickup-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
}

.aw-bulk-pickup-label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    color: var(--aw-gray-600);
}

.aw-bulk-pickup-label .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--aw-primary);
}

.aw-bulk-row select.aw-bulk-service-select,
.aw-bulk-row select.aw-bulk-pickup-date,
.aw-bulk-row select.aw-bulk-pickup-time {
    min-height: 28px;
    height: 28px;
    padding: 0 24px 0 8px;
    font-size: 12px;
    line-height: 26px;
    border-color: var(--aw-gray-300);
    border-radius: 4px;
}

.aw-bulk-row select.aw-bulk-pickup-date {
    flex: 0 1 170px;
    min-width: 0;
}

.aw-bulk-row select.aw-bulk-pickup-time {
    flex: 0 1 140px;
    min-width: 0;
}

.aw-bulk-pickup-msg {
    color: var(--aw-gray-500);
}

.aw-bulk-pickup-line.is-empty .aw-bulk-pickup-msg {
    color: #b91c1c;
}

.aw-bulk-pickup-default {
    display: inline-flex;
    color: #b45309;
    cursor: help;
}

.aw-bulk-pickup-default .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

.aw-bulk-shiptype-hint {
    margin: 8px 0 0;
}

.aw-bulk-excluded {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--aw-gray-200);
    font-size: 12px;
    color: var(--aw-gray-500);
}

.aw-bulk-excluded .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

/* ========================================
   Right column: shipment type, balance
   ======================================== */
.aw-bulk-shiptype-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.aw-bulk-shiptype-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    background: #fff;
    border: 1.5px solid var(--aw-gray-200);
    border-radius: var(--aw-radius);
    text-align: left;
    cursor: pointer;
    transition: var(--aw-transition);
}

.aw-bulk-shiptype-btn .dashicons {
    color: var(--aw-gray-400);
}

.aw-bulk-shiptype-btn > span:last-child {
    display: flex;
    flex-direction: column;
}

.aw-bulk-shiptype-btn strong {
    font-size: 13px;
    color: var(--aw-gray-800);
}

.aw-bulk-shiptype-btn small {
    font-size: 11px;
    color: var(--aw-gray-500);
}

.aw-bulk-shiptype-btn:hover {
    border-color: var(--aw-gray-300);
}

.aw-bulk-shiptype-btn.selected {
    border-color: var(--aw-primary);
    background: var(--aw-primary-light);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.08);
}

.aw-bulk-shiptype-btn.selected .dashicons,
.aw-bulk-shiptype-btn.selected strong {
    color: var(--aw-primary);
}

.aw-bulk-alert {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: var(--aw-radius);
    font-size: 12px;
    line-height: 1.5;
    animation: errorFadeIn 0.25s ease;
}

.aw-bulk-alert .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.aw-bulk-alert.is-danger {
    background: var(--aw-danger-light);
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.aw-bulk-alert.is-warning {
    background: var(--aw-warning-light);
    border: 1px solid #fde68a;
    color: #92400e;
}

.aw-bulk-balance .aw-section-title {
    position: relative;
}

.aw-bulk-refresh {
    margin-left: auto;
    padding: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--aw-gray-400);
}

.aw-bulk-refresh:hover {
    background: var(--aw-gray-100);
    color: var(--aw-primary);
}

.aw-bulk-balance-loading {
    display: flex;
    justify-content: center;
    padding: 18px 0;
}

.aw-bulk-balance-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: var(--aw-gray-600);
}

.aw-bulk-bal-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.aw-bulk-bal-row.is-balance {
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: var(--aw-radius);
    background: linear-gradient(135deg, #e8f4f8 0%, #f5fbfd 100%);
    color: var(--aw-gray-700);
    font-size: 13px;
}

.aw-bulk-bal-row.is-balance strong {
    color: var(--aw-primary);
    font-size: 15px;
}

.aw-bulk-bal-row.is-total {
    margin-top: 4px;
    padding-top: 7px;
    border-top: 1px dashed var(--aw-gray-200);
    color: var(--aw-gray-900);
    font-size: 13px;
}

.aw-bulk-bal-row.is-remaining strong {
    color: #15803d;
}

.aw-bulk-bal-row.is-remaining.is-short strong {
    color: #dc2626;
}

.aw-bulk-bal-row.is-cod span:last-child {
    color: #047857;
    font-weight: 600;
}

.aw-bulk-bal-row.is-cashback span:last-child {
    color: #92400e;
    font-weight: 600;
}

.aw-bulk-billing-note {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin: 10px 0 0;
    padding: 8px 10px;
    border-radius: var(--aw-radius);
    background: var(--aw-gray-50);
}

.aw-bulk-billing-note .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--aw-primary);
}

.aw-bulk-topup-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.aw-bulk-topup-row .aw-btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 12px;
}

/* ========================================
   Footer
   ======================================== */
.aw-bulk-footer {
    justify-content: space-between;
    align-items: center;
}

.aw-bulk-footer-info {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    font-size: 12px;
    color: var(--aw-gray-500);
}

.aw-bulk-footer-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.aw-bulk-footer-info.is-ready {
    color: #15803d;
    font-weight: 600;
}

.aw-bulk-footer-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#aw-bulk-process-btn:not(:disabled) {
    background: linear-gradient(135deg, var(--aw-primary) 0%, #0891b2 100%);
}

/* ========================================
   Processing view
   ======================================== */
.aw-bulk-process-top {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(0, 1.4fr);
    gap: 14px;
    margin-bottom: 14px;
}

.aw-bulk-wallet {
    position: relative;
    overflow: hidden;
    padding: 18px 20px 16px;
    border-radius: var(--aw-radius-lg);
    background: linear-gradient(135deg, #005a87 0%, #0073aa 55%, #0891b2 100%);
    color: #fff;
    box-shadow: 0 10px 25px -8px rgba(0, 90, 135, 0.55);
}

/* No AgenWebsite balance (integrator bills the merchant): count ongkir up */
.aw-bulk-wallet.is-counter {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 55%, #14b8a6 100%);
    box-shadow: 0 10px 25px -8px rgba(13, 148, 136, 0.5);
}

.aw-bulk-wallet.is-counter .aw-bulk-chip-fly {
    color: #047857;
}

.aw-bulk-wallet-shine {
    position: absolute;
    top: -60%;
    left: -40%;
    width: 40%;
    height: 220%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(20deg);
    animation: awBulkShine 3.2s ease-in-out infinite;
    pointer-events: none;
}

.aw-bulk-wallet.is-done .aw-bulk-wallet-shine {
    animation: none;
    opacity: 0;
}

@keyframes awBulkShine {
    0% { left: -40%; }
    60%, 100% { left: 130%; }
}

.aw-bulk-wallet-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.85;
}

.aw-bulk-wallet-label .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aw-bulk-wallet-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.aw-bulk-wallet-currency {
    font-size: 16px;
    font-weight: 600;
    opacity: 0.85;
}

#aw-bulk-wallet-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.aw-bulk-wallet.is-cutting #aw-bulk-wallet-value {
    animation: awBulkShake 0.45s ease;
}

@keyframes awBulkShake {
    0%, 100% { transform: none; }
    25% { transform: translateY(1px) scale(0.98); }
    50% { transform: translateY(-1px); }
}

.aw-bulk-wallet-spent {
    margin-top: 6px;
    min-height: 16px;
    font-size: 12px;
    opacity: 0.85;
}

/* The "cut": a dashed line sweeps across the card with a spinning blade */
.aw-bulk-wallet-cutline {
    position: absolute;
    left: 0;
    right: 0;
    top: 58%;
    height: 0;
    border-top: 2px dashed rgba(255, 255, 255, 0.9);
    clip-path: inset(-12px 100% -12px 0);
    opacity: 0;
    pointer-events: none;
}

.aw-bulk-wallet-cutline .dashicons {
    position: absolute;
    top: -11px;
    left: -20px;
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #fde68a;
}

.aw-bulk-wallet.is-cutting .aw-bulk-wallet-cutline {
    animation: awBulkCut 0.75s ease-out;
}

.aw-bulk-wallet.is-cutting .aw-bulk-wallet-cutline .dashicons {
    animation: awBulkBlade 0.75s ease-out;
}

@keyframes awBulkCut {
    0% { opacity: 1; clip-path: inset(-12px 100% -12px 0); }
    70% { opacity: 1; clip-path: inset(-12px 0 -12px 0); }
    100% { opacity: 0; clip-path: inset(-12px 0 -12px 0); }
}

@keyframes awBulkBlade {
    0% { left: -20px; transform: rotate(0deg); }
    70% { left: calc(100% - 4px); transform: rotate(540deg); }
    100% { left: calc(100% - 4px); transform: rotate(600deg); }
}

.aw-bulk-wallet-chips {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
}

.aw-bulk-chip-fly {
    position: absolute;
    top: 52%;
    padding: 3px 9px;
    border-radius: 999px;
    background: #fff;
    color: #dc2626;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    animation: awBulkChipFly 1.4s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes awBulkChipFly {
    0% { opacity: 0; transform: translateY(8px) scale(0.7); }
    15% { opacity: 1; transform: translateY(0) scale(1.05); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-58px) scale(0.95) rotate(-4deg); }
}

.aw-bulk-progress-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 16px 18px;
    border-radius: var(--aw-radius-lg);
    background: #fff;
    border: 1px solid var(--aw-gray-200);
}

.aw-bulk-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 22px;
}

.aw-bulk-status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--aw-primary-light);
    border-top-color: var(--aw-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.aw-bulk-status-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--aw-gray-900);
    opacity: 0;
}

.aw-bulk-status-text.is-in {
    animation: awBulkTextIn 0.4s ease forwards;
}

@keyframes awBulkTextIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.aw-bulk-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--aw-gray-500);
    font-variant-numeric: tabular-nums;
}

.aw-bulk-progress-track {
    height: 12px;
    border-radius: 999px;
    background: var(--aw-gray-100);
    overflow: hidden;
}

.aw-bulk-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background-color: var(--aw-primary);
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.22) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0.22) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    animation: awBulkStripes 0.8s linear infinite;
    transition: width 0.5s ease;
}

#aw-bulk-modal[data-view="done"] .aw-bulk-progress-fill {
    animation: none;
    background-color: var(--aw-success);
}

@keyframes awBulkStripes {
    from { background-position: 20px 0; }
    to { background-position: 0 0; }
}

.aw-bulk-tip {
    min-height: 16px;
    font-size: 12px;
    color: var(--aw-gray-500);
    opacity: 0;
}

.aw-bulk-tip.is-in {
    animation: awBulkTextIn 0.5s ease forwards;
}

.aw-bulk-process-list {
    display: flex;
    flex-direction: column;
}

.aw-bulk-prow {
    display: grid;
    grid-template-columns: 24px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.4fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--aw-gray-100);
    font-size: 12px;
    color: var(--aw-gray-700);
    transition: background 0.3s ease;
}

.aw-bulk-prow:last-child {
    border-bottom: none;
}

.aw-bulk-prow-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.aw-bulk-prow-icon .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

.aw-bulk-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aw-gray-300);
}

.aw-bulk-prow-order,
.aw-bulk-prow-service,
.aw-bulk-prow-msg {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aw-bulk-prow-service {
    color: var(--aw-gray-500);
}

.aw-bulk-prow-amount {
    font-weight: 700;
    color: #dc2626;
    font-variant-numeric: tabular-nums;
    animation: awBulkPop 0.3s ease;
}

.aw-bulk-prow-amount.is-neutral {
    color: var(--aw-gray-700);
}

.aw-bulk-prow.is-queued { color: var(--aw-gray-400); }
.aw-bulk-prow.is-working { background: #f0f7fb; }
.aw-bulk-prow.is-working .aw-bulk-prow-msg { color: var(--aw-primary); font-weight: 600; }

.aw-bulk-prow.is-success .aw-bulk-prow-icon,
.aw-bulk-prow.is-waiting .aw-bulk-prow-icon {
    background: var(--aw-success);
    color: #fff;
    animation: awBulkPop 0.3s ease;
}

.aw-bulk-prow.is-waiting .aw-bulk-prow-icon {
    background: #0891b2;
}

.aw-bulk-prow.is-success .aw-bulk-prow-msg {
    font-family: Menlo, Consolas, monospace;
    font-weight: 700;
    color: #15803d;
}

.aw-bulk-prow.is-waiting .aw-bulk-prow-msg { color: #0e7490; }

.aw-bulk-prow.is-failed .aw-bulk-prow-icon {
    background: var(--aw-danger);
    color: #fff;
    animation: awBulkPop 0.3s ease;
}

.aw-bulk-prow.is-failed .aw-bulk-prow-msg { color: #b91c1c; white-space: normal; }

.aw-bulk-prow.is-skipped .aw-bulk-prow-icon,
.aw-bulk-prow.is-stopped .aw-bulk-prow-icon {
    background: var(--aw-gray-200);
    color: var(--aw-gray-600);
}

.aw-bulk-prow.is-unknown .aw-bulk-prow-icon {
    background: var(--aw-warning);
    color: #fff;
}

.aw-bulk-prow.is-unknown .aw-bulk-prow-msg { color: #92400e; white-space: normal; }

/* Result */
.aw-bulk-done {
    margin-bottom: 14px;
}

.aw-bulk-done-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: var(--aw-radius-lg);
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    animation: modalSlideIn 0.35s ease;
}

.aw-bulk-done-card.is-partial {
    background: #fffbeb;
    border-color: #fde68a;
}

.aw-bulk-done-card.is-failed {
    background: var(--aw-danger-light);
    border-color: #fecaca;
}

.aw-bulk-done-card.is-partial { --aw-bulk-burst: var(--aw-warning); }
.aw-bulk-done-card.is-failed { --aw-bulk-burst: var(--aw-danger); }

.aw-bulk-done-burst {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--aw-bulk-burst, var(--aw-success));
    color: #fff;
    animation: awBulkPop 0.45s ease;
}

.aw-bulk-done-burst::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--aw-bulk-burst, var(--aw-success));
    animation: awBulkRing 1s ease-out 0.15s both;
}

.aw-bulk-done-burst .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
}

@keyframes awBulkRing {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.8); opacity: 0; }
}

.aw-bulk-done-text h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--aw-gray-900);
}

.aw-bulk-done-stats,
.aw-bulk-done-money {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
    color: var(--aw-gray-600);
}

.aw-bulk-done-money {
    margin-top: 4px;
}

.aw-bulk-done-stats .is-success strong { color: #15803d; }
.aw-bulk-done-stats .is-failed strong { color: #dc2626; }
.aw-bulk-done-stats .is-skipped strong { color: var(--aw-gray-500); }

/* ========================================
   Responsive
   ======================================== */
@media screen and (max-width: 960px) {
    .aw-bulk-grid,
    .aw-bulk-process-top {
        grid-template-columns: 1fr;
    }

    .aw-bulk-col-right {
        position: static;
    }

    .aw-bulk-steps {
        display: none;
    }
}

@media screen and (max-width: 782px) {
    .wrap .button.aw-bulk-ship-trigger {
        float: none;
        margin: 8px 0 0;
    }

    .aw-bulk-container {
        height: calc(100vh - 20px);
    }

    .aw-bulk-prow {
        grid-template-columns: 24px minmax(0, 1fr) auto;
    }

    .aw-bulk-prow-service {
        display: none;
    }

    .aw-bulk-prow-msg {
        grid-column: 2 / -1;
    }
}

@media screen and (max-width: 600px) {
    .aw-bulk-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .aw-bulk-footer-actions {
        justify-content: flex-end;
    }

    .aw-bulk-shiptype-toggle {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    #aw-bulk-modal *,
    #aw-bulk-select-modal *,
    .aw-bulk-ship-trigger * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
