/**
 * Fulfillment Orders List Styles
 * Beautiful Minimalist Design
 *
 * @author AgenWebsite Shipping
 * @package AgenWebsite Shipping
 * @since 2.2.0
 */

/* ========================================
   CSS Variables - Design Tokens
   ======================================== */
:root {
    --aw-primary: #0073aa;
    --aw-primary-hover: #005a87;
    --aw-primary-light: #e8f4f8;
    --aw-success: #22c55e;
    --aw-success-light: #dcfce7;
    --aw-warning: #f59e0b;
    --aw-warning-light: #fef3c7;
    --aw-danger: #ef4444;
    --aw-danger-light: #fef2f2;
    --aw-gray-50: #f9fafb;
    --aw-gray-100: #f3f4f6;
    --aw-gray-200: #e5e7eb;
    --aw-gray-300: #d1d5db;
    --aw-gray-400: #9ca3af;
    --aw-gray-500: #6b7280;
    --aw-gray-600: #4b5563;
    --aw-gray-700: #374151;
    --aw-gray-800: #1f2937;
    --aw-gray-900: #111827;
    --aw-radius-sm: 4px;
    --aw-radius: 8px;
    --aw-radius-lg: 12px;
    --aw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --aw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --aw-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --aw-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --aw-transition: all 0.2s ease;
}

/* ========================================
   Column & Table Styles
   ======================================== */
.column-aw_fulfillment {
    width: 180px;
}

/* AWB Display */
.aw-awb {
    display: inline-block;
    font-weight: 600;
    color: var(--aw-primary);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
    background: var(--aw-primary-light);
    padding: 4px 8px;
    border-radius: var(--aw-radius-sm);
}

/* Badge Styles */
.aw-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 14px;
}

.aw-badge-pending {
    background: var(--aw-warning-light);
    color: #b45309;
}

.aw-badge-shipped {
    background: var(--aw-success-light);
    color: #15803d;
}

.aw-badge-waiting {
    background: #dbeafe;
    color: #1d4ed8;
}

.aw-badge-expired {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Action Buttons */
.aw-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.aw-actions .button {
    padding: 0 10px;
    min-height: 30px;
    line-height: 28px;
    border-radius: var(--aw-radius-sm);
    transition: var(--aw-transition);
}

.aw-actions .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-top: 7px;
}

/* ========================================
   Modal - Beautiful Minimalist Design
   ======================================== */
.aw-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.aw-modal-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);
}

.aw-modal-container {
    position: relative;
    background: #fff;
    border-radius: var(--aw-radius-lg);
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--aw-shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.aw-modal-small { max-width: 450px; }
.aw-modal-medium { max-width: 600px; }
.aw-modal-large { max-width: 900px; }

/* Modal Header */
.aw-modal-header {
    padding: 20px 24px;
    border-bottom: 2px solid var(--aw-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--aw-gray-50) 0%, #fff 100%);
}

.aw-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--aw-gray-900);
    letter-spacing: -0.025em;
}

.aw-modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--aw-gray-800);
}

.aw-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--aw-radius);
    cursor: pointer;
    color: var(--aw-gray-400);
    font-size: 24px;
    line-height: 1;
    transition: var(--aw-transition);
}

.aw-modal-close:hover {
    background: var(--aw-gray-100);
    color: var(--aw-gray-700);
}

/* Modal Body */
.aw-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    background: var(--aw-gray-50);
}

/* Modal Footer */
.aw-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--aw-gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    background: #fff;
}

/* ========================================
   Custom Buttons
   ======================================== */
.aw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--aw-radius);
    border: none;
    cursor: pointer;
    transition: var(--aw-transition);
    text-decoration: none;
}

.aw-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aw-btn-primary {
    background: var(--aw-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 115, 170, 0.3);
}

.aw-btn-primary:hover:not(:disabled) {
    background: var(--aw-primary-hover);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
    transform: translateY(-1px);
}

.aw-btn-primary:disabled {
    background: var(--aw-gray-300);
    color: var(--aw-gray-500);
    cursor: not-allowed;
    box-shadow: none;
}

.aw-btn-secondary {
    background: #fff;
    color: var(--aw-gray-700);
    border: 1px solid var(--aw-gray-300);
}

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

/* ========================================
   Loading States - Beautiful Spinners
   ======================================== */
.aw-loading {
    text-align: center;
    padding: 48px 24px;
}

.aw-loading p {
    margin-top: 16px;
    color: var(--aw-gray-500);
    font-size: 14px;
}

.aw-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--aw-gray-200);
    border-radius: 50%;
    border-top-color: var(--aw-primary);
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.aw-spinner-small {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--aw-gray-200);
    border-radius: 50%;
    border-top-color: var(--aw-primary);
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.aw-rates-loading,
.aw-pickup-times-loading {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--aw-gray-500);
    font-size: 14px;
    gap: 10px;
}

/* ========================================
   Sections
   ======================================== */
.aw-section {
    background: #fff;
    border-radius: var(--aw-radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--aw-gray-200);
}

.aw-section:last-child {
    margin-bottom: 0;
}

.aw-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--aw-gray-100);
    font-size: 15px;
    font-weight: 600;
    color: var(--aw-gray-800);
}

.aw-section-title .dashicons {
    color: var(--aw-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ========================================
   Form Elements - Clean Design
   ======================================== */
.aw-form-group {
    margin-bottom: 16px;
}

.aw-form-group:last-child {
    margin-bottom: 0;
}

.aw-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--aw-gray-700);
}

.aw-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--aw-gray-300);
    border-radius: var(--aw-radius);
    background: #fff;
    color: var(--aw-gray-800);
    transition: var(--aw-transition);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.aw-select:focus {
    outline: none;
    border-color: var(--aw-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.aw-select:hover {
    border-color: var(--aw-gray-400);
}

.aw-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ========================================
   Notice/Alert Components
   ======================================== */
.aw-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--aw-radius);
    font-size: 13px;
    margin-top: 16px;
}

.aw-notice .dashicons {
    flex-shrink: 0;
    margin-top: 1px;
}

.aw-notice-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.aw-notice-info .dashicons {
    color: #3b82f6;
}

.aw-notice-warning {
    background: var(--aw-warning-light);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.aw-notice-warning .dashicons {
    color: var(--aw-warning);
}

/* Status Colors */
.status-pending { color: #b45309; }
.status-shipped { color: var(--aw-primary); }
.status-delivered { color: #15803d; }
.status-failed { color: var(--aw-danger); }

/* ========================================
   Order Preview Styles
   ======================================== */

/* Order Summary */
.aw-order-summary {
    background: #FFF;
    padding: 0;
    border-radius: 5px;
    margin-bottom: 10px;
}

.aw-order-summary h4 {
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #23282d;
    font-size: 14px;
}

.aw-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.aw-summary-item {
    background: #fff;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #eee;
}

.aw-summary-item label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 5px;
}

.aw-summary-item span {
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
}

/* Customer Shipping Section */
.aw-customer-shipping {
    margin-bottom: 20px;
}

.aw-customer-shipping-box {
    background: #fff8e1;
    border: 1px solid #ffcc80;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.aw-customer-shipping-box .dashicons {
    color: #f57c00;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.aw-customer-shipping-content {
    flex: 1;
}

.aw-customer-shipping-content strong {
    display: block;
    color: #f57c00;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.aw-shipping-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.aw-shipping-price {
    font-weight: bold;
    color: #2e7d32;
}

/* ========================================
   Info Grid (Shipper/Receiver - Everpro Pattern)
   ======================================== */

.aw-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.aw-info-box {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    background: #fff;
}

.aw-info-box h4 {
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #0073aa;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aw-info-box h4 .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aw-info-content {
    font-size: 13px;
    line-height: 1.7;
    color: #374151;
}

.aw-info-content strong {
    color: #1e293b;
    font-size: 14px;
}

.aw-contact-line {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 12px;
}

.aw-contact-line .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

/* ========================================
   Compact Address Form (Everpro Pattern)
   ======================================== */

.aw-address-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aw-field-row {
    display: flex;
    gap: 8px;
}

.aw-field {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.aw-field-full {
    width: 100%;
}

.aw-field-half {
    flex: 1;
    min-width: 0;
}

.aw-field label {
    font-size: 11px;
    color: #999;
    font-weight: 400;
    margin: 0;
}

.aw-field-value {
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 12px;
    color: #1e1e1e;
    min-height: 14px;
    word-break: break-word;
}

/* Responsive for address form */
@media (max-width: 768px) {
    .aw-field-row {
        flex-direction: column;
    }

    .aw-field-half {
        width: 100%;
    }
}

/* Legacy Address Grid (keeping for backwards compatibility) */
.aw-address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.aw-address-box {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    background: #fff;
}

.aw-address-box h4 {
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    color: #0073aa;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aw-address-box h4 .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aw-address-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 13px;
}

.aw-address-row:last-child {
    margin-bottom: 0;
}

.aw-address-label {
    width: 80px;
    color: #666;
    flex-shrink: 0;
}

.aw-address-value {
    color: #23282d;
    flex: 1;
}

/* ========================================
   Items Data Table
   ======================================== */

.aw-items-section {
    margin-bottom: 20px;
}

.aw-items-section h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #23282d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aw-items-data-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    font-size: 13px;
}

.aw-items-data-table thead {
    background: #f8f9fa;
}

.aw-items-data-table th,
.aw-items-data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.aw-items-data-table th {
    font-weight: 600;
    color: #23282d;
    font-size: 12px;
    text-transform: uppercase;
}

.aw-items-data-table tbody tr:hover {
    background: #f9f9f9;
}

.aw-items-data-table .text-center {
    text-align: center;
}

.aw-items-data-table .text-right {
    text-align: right;
}

.aw-items-data-table tfoot {
    background: #f8f9fa;
    font-weight: 600;
}

/* Shipping Summary Below Items */
.aw-shipping-summary {
    margin-top: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

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

.aw-shipping-label {
    font-size: 13px;
    color: #666;
}

.aw-shipping-method {
    flex: 1;
    font-weight: 600;
    color: #23282d;
}

.aw-shipping-cost {
    font-weight: bold;
    color: #2e7d32;
}

/* ========================================
   Rate Cards with Logos
   ======================================== */

.aw-rate-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 0;
}

.aw-rate-logo {
    flex-shrink: 0;
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aw-rate-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.aw-rate-info {
    flex-grow: 1;
}

.aw-rate-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.aw-rate-title {
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
}

.aw-preferred-badge {
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}

.aw-flat-rate-badge {
    background: #ff9800;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
}

.aw-rate-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.aw-rate-duration {
    display: flex;
    align-items: center;
    gap: 4px;
}

.aw-rate-duration .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aw-pickup-today {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #4caf50;
}

.aw-pickup-today .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #4caf50;
}

.aw-rate-pricing {
    flex-shrink: 0;
    text-align: right;
}

.aw-rate-price-display {
    font-size: 16px;
    font-weight: bold;
    color: #23282d;
}

.aw-rate-discount {
    margin-top: 5px;
    font-size: 12px;
    color: #4caf50;
}

.aw-discount-label {
    color: #666;
    margin-right: 4px;
}

.aw-discount-amount {
    font-weight: 600;
    color: #4caf50;
}

/* ========================================
   Pickup Times Section
   ======================================== */

.aw-pickup-times-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e1e4e8;
}

.aw-pickup-times-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
}

.aw-pickup-times-container {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

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

.aw-logistic-header strong {
    color: #0073aa;
    font-size: 14px;
}

.aw-rate-code {
    background: #e1e4e8;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
}

.aw-pickup-date-selector,
.aw-pickup-date-row {
    margin-bottom: 15px;
}

.aw-pickup-date-selector label,
.aw-pickup-date-row label {
    display: inline-block;
    margin-right: 10px;
    font-weight: 600;
    color: #555;
}

.aw-pickup-date-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

.aw-pickup-time-slots,
.aw-pickup-time-row {
    margin-top: 15px;
}

.aw-pickup-time-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.aw-time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.aw-time-slot {
    display: block;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.aw-time-slot:hover {
    border-color: #0073aa;
    background: #f5f9fc;
}

.aw-time-slot.selected {
    border-color: #0073aa;
    background: #e8f4f8;
}

.aw-time-slot.aw-cutoff {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.aw-time-slot input[type="radio"] {
    display: none;
}

.aw-time-slot-display {
    display: block;
    font-size: 13px;
    color: #333;
}

.aw-cutoff-label {
    display: block;
    color: #dc3545;
    font-size: 11px;
    margin-top: 4px;
}

.aw-pickup-times-notice,
.aw-pickup-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

.aw-pickup-times-notice .dashicons,
.aw-pickup-notice .dashicons {
    flex-shrink: 0;
    color: #ffc107;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.aw-no-pickup-times {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
    color: #666;
}

.aw-pickup-times-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* ========================================
   Configuration Cards
   ======================================== */

.aw-config-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.aw-config-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.aw-config-card-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aw-config-card-header h3 .dashicons {
    color: #0073aa;
}

.aw-config-card-body {
    padding: 20px;
}

.aw-config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.aw-config-field {
    margin-bottom: 15px;
}

.aw-config-field:last-child {
    margin-bottom: 0;
}

.aw-config-field label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 13px;
}

.aw-config-field input[type="text"],
.aw-config-field input[type="email"],
.aw-config-field input[type="password"],
.aw-config-field select,
.aw-config-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.aw-config-field input:focus,
.aw-config-field select:focus,
.aw-config-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.aw-config-field textarea {
    min-height: 80px;
    resize: vertical;
}

.aw-config-field .description {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.aw-config-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aw-config-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.aw-config-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========================================
   Error Messages
   ======================================== */

.aw-error-message {
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 5px;
    border: 1px solid #fecaca;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.aw-error-message .dashicons {
    flex-shrink: 0;
    margin-top: 2px;
}

.aw-no-rates {
    color: #dc2626;
    padding: 15px;
    text-align: center;
}

/* ========================================
   Button Variants
   ======================================== */

.button-danger {
    background: #b32d2e !important;
    border-color: #8a2425 !important;
    color: #fff !important;
}

.button-danger:hover {
    background: #8a2425 !important;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .column-aw_fulfillment {
        width: auto;
    }

    .aw-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .aw-rates-list {
        grid-template-columns: 1fr;
    }

    .aw-address-grid,
    .aw-info-grid {
        grid-template-columns: 1fr;
    }

    .aw-config-grid {
        grid-template-columns: 1fr;
    }

    .aw-time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .aw-rate-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .aw-rate-pricing {
        text-align: left;
    }

    .aw-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========================================
   Rate Modal Specific Styles
   ======================================== */

/* Order Preview */
.aw-order-preview {
    background: #FFF;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.aw-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.aw-preview-section h5 {
    margin: 0 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
}

.aw-preview-section p {
    margin: 5px 0;
    font-size: 13px;
}

/* Section Headers */
.aw-section-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.aw-section-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.aw-section-header h4 .dashicons {
    color: #0073aa;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Rates Section */
.aw-rates-section {
    margin-bottom: 20px;
}

.aw-rates-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Rate Item Card */
.aw-rate-item {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aw-rate-item:hover {
    border-color: #0073aa;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.aw-rate-item.selected {
    border-color: #0073aa;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

/* Rate Card Layout */
.aw-rate-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.aw-rate-logo {
    flex-shrink: 0;
    width: 60px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 5px;
}

.aw-rate-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.aw-rate-logo-placeholder {
    width: 60px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.aw-rate-info {
    flex: 1;
    min-width: 0;
}

.aw-rate-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.aw-rate-logistic {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.aw-rate-service {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.aw-rate-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.aw-rate-duration {
    display: flex;
    align-items: center;
    gap: 4px;
}

.aw-rate-duration .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.aw-pickup-today {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #16a34a;
    font-weight: 500;
}

.aw-pickup-today .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #16a34a;
}

/* Rate Badges */
.aw-flat-rate-badge {
    background: #fef3c7;
    color: #b45309;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.aw-preferred-badge {
    background: #dcfce7;
    color: #15803d;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Rate Pricing */
.aw-rate-pricing {
    flex-shrink: 0;
    text-align: right;
    min-width: 120px;
}

.aw-rate-price-display {
    font-size: 16px;
    font-weight: 700;
    color: #0073aa;
}

.aw-rate-discount {
    margin-top: 4px;
    font-size: 11px;
}

.aw-discount-label {
    color: #64748b;
}

.aw-discount-amount {
    font-weight: 600;
    color: #16a34a;
}

/* Rates Empty State */
.aw-rates-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.aw-rates-empty .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #fbbf24;
    margin-bottom: 12px;
    display: block;
    margin: 0 auto;
}

.aw-rates-empty p {
    margin: 0;
    font-size: 14px;
}

/* Pickup Times Wrapper */
.aw-pickup-times-wrapper {
    margin-bottom: 20px;
    padding: 20px;
    background: #FFF;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Cost Summary - Beautiful Green Theme */
.aw-cost-summary {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: var(--aw-radius);
    padding: 20px;
    border: 1px solid #bbf7d0;
}

.aw-cost-summary .aw-section-title {
    border-bottom-color: #bbf7d0;
}

.aw-cost-summary .aw-section-title .dashicons {
    color: #16a34a;
}

/* Cost Breakdown */
.aw-cost-breakdown {
    background: #fff;
    border-radius: var(--aw-radius);
    overflow: hidden;
    border: 1px solid #bbf7d0;
}

.aw-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #ecfdf5;
}

.aw-cost-row:last-child {
    border-bottom: none;
}

.aw-cost-label {
    font-size: 14px;
    color: var(--aw-gray-600);
}

.aw-cost-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--aw-gray-800);
}

.aw-cost-discount {
    background: #f0fdf4;
}

.aw-cost-discount .aw-cost-label,
.aw-cost-discount .aw-cost-value {
    color: #16a34a;
    font-size: 13px;
}

.aw-cost-pro-teaser-wrapper {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-top: 1px dashed #fbbf24;
    border-radius: 0 0 var(--aw-radius) var(--aw-radius);
}

.aw-cost-pro-teaser {
    border-bottom: none;
    padding-bottom: 0;
}

.aw-cost-pro-teaser .aw-cost-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #92400e;
}

.aw-cost-pro-teaser .aw-cost-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.aw-pro-teaser-desc {
    padding: 0 16px 14px;
    font-size: 12px;
    color: #92400e;
}

/* PRO teaser in rate cards */
.aw-rate-pro-teaser {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    margin-top: 4px;
}

.aw-pro-badge {
    background: #f60;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.aw-pro-teaser-text {
    color: #16a34a;
    font-weight: 500;
}

.aw-cost-fee {
    background: #fffbeb;
}

.aw-cost-fee .aw-cost-label,
.aw-cost-fee .aw-cost-value {
    color: #b45309;
    font-size: 13px;
}

.aw-cost-total {
    background: #f0fdf4;
    border-top: 2px solid #22c55e;
}

.aw-cost-total .aw-cost-label {
    font-size: 15px;
    font-weight: 700;
    color: #15803d;
}

.aw-cost-total .aw-cost-value {
    font-size: 18px;
    font-weight: 700;
    color: #15803d;
}

/* Legacy Summary Rows (backwards compatibility) */
.aw-summary-rows {
    margin-top: 15px;
}

.aw-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #dcfce7;
    font-size: 14px;
}

.aw-summary-row:last-child {
    border-bottom: none;
}

.aw-fee-row {
    color: #b45309;
    font-size: 13px;
}

.aw-total-row {
    font-size: 16px;
    padding-top: 12px;
    margin-top: 5px;
    border-top: 2px solid #bbf7d0;
    border-bottom: none;
}

.aw-total-row strong {
    color: #15803d;
}

/* Responsive Styles for Rate Modal */
@media screen and (max-width: 782px) {
    .aw-rate-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .aw-rate-logo {
        width: 50px;
        height: 35px;
    }

    .aw-rate-pricing {
        text-align: left;
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid #e5e7eb;
    }

    .aw-options-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .aw-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Balance Info in Cost Summary
   ======================================== */

.aw-balance-info-row {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: var(--aw-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.aw-balance-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.aw-balance-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aw-balance-icon .dashicons {
    color: #2563eb;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.aw-balance-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
}

.aw-btn-refresh-balance {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--aw-transition);
}

.aw-btn-refresh-balance:hover {
    background: rgba(37, 99, 235, 0.1);
}

.aw-btn-refresh-balance .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #3b82f6;
}

.aw-balance-amount {
    font-size: 20px;
    font-weight: 700;
    color: #1e40af;
    flex: 1;
    text-align: right;
}

.aw-balance-amount .aw-balance-loading {
    font-size: 14px;
    font-weight: normal;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.aw-btn-topup-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: var(--aw-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--aw-transition);
}

.aw-btn-topup-inline:hover {
    background: #1d4ed8;
}

.aw-btn-topup-inline .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Remaining Balance Row */
.aw-cost-remaining {
    background: #f8fafc;
    border-top: 1px dashed #cbd5e1;
}

.aw-cost-remaining .aw-cost-label {
    color: #64748b;
    font-size: 13px;
}

.aw-cost-remaining .aw-cost-value {
    font-weight: 600;
}

.aw-text-success {
    color: #16a34a !important;
}

.aw-text-danger {
    color: #dc2626 !important;
}

/* Balance Warning */
.aw-balance-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--aw-radius);
    margin-top: 12px;
    color: #dc2626;
    font-size: 13px;
}

.aw-balance-warning .dashicons {
    color: #ef4444;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ========================================
   Inline Topup Section
   ======================================== */

.aw-inline-topup {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    margin-bottom: 20px;
}

.aw-inline-topup .aw-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom-color: #fbbf24;
}

.aw-inline-topup .aw-section-title .dashicons:first-child {
    color: #d97706;
}

.aw-close-inline-topup {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--aw-transition);
    margin-left: auto;
}

.aw-close-inline-topup:hover {
    background: rgba(217, 119, 6, 0.1);
}

.aw-close-inline-topup .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #92400e;
}

.aw-topup-options {
    background: #fff;
    border-radius: var(--aw-radius);
    padding: 16px;
}

.aw-topup-label {
    margin: 0 0 12px 0;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.aw-quick-topup-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.aw-quick-topup-option {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: var(--aw-radius);
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--aw-transition);
    color: #374151;
}

.aw-quick-topup-option:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.aw-quick-topup-option.selected {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1e40af;
}

.aw-custom-topup-row {
    margin-bottom: 16px;
}

.aw-custom-topup-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #64748b;
}

.aw-custom-topup-input {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: var(--aw-radius);
    overflow: hidden;
}

.aw-currency-prefix {
    padding: 8px 12px;
    background: #f3f4f6;
    color: #64748b;
    font-weight: 500;
    border-right: 1px solid #d1d5db;
}

.aw-custom-topup-input input {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.aw-custom-topup-input input:focus {
    box-shadow: none;
}

.aw-topup-action {
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

/* Responsive for inline topup */
@media screen and (max-width: 600px) {
    .aw-quick-topup-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .aw-balance-display {
        flex-direction: column;
        text-align: center;
    }

    .aw-balance-amount {
        order: 2;
    }

    .aw-btn-topup-inline {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Eligibility Notice Styling
   ======================================== */
.aw-fulfillment-eligibility-notice {
    border-left-color: #f59e0b !important;
}

.aw-fulfillment-eligibility-notice p {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0.5em 0;
}

.aw-fulfillment-eligibility-notice .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.aw-fulfillment-eligibility-notice .button {
    margin-left: auto;
}

@media screen and (max-width: 782px) {
    .aw-fulfillment-eligibility-notice p {
        flex-direction: column;
        align-items: flex-start;
    }

    .aw-fulfillment-eligibility-notice .button {
        margin-left: 0;
        margin-top: 8px;
    }
}

/* ========================================
   Create AWB Error Notice
   ======================================== */
.aw-error-notice {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-radius: var(--aw-radius);
    padding: 16px;
    margin-top: 16px;
    animation: errorFadeIn 0.3s ease;
}

@keyframes errorFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aw-error-notice .aw-error-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.aw-error-notice .dashicons {
    flex-shrink: 0;
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #dc2626;
    margin-top: 2px;
}

.aw-error-notice .aw-error-text {
    color: #b91c1c;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

/* ========================================
   Payment Type Selection
   ======================================== */

.aw-payment-type-section {
    margin-bottom: 16px;
}

.aw-payment-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.aw-payment-option {
    position: relative;
    display: block;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: var(--aw-radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--aw-transition);
}

.aw-payment-option:hover {
    border-color: var(--aw-primary);
    background: #f8fafc;
}

.aw-payment-option.selected {
    border-color: var(--aw-primary);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.aw-payment-option input[type="radio"] {
    display: none;
}

.aw-payment-option-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aw-payment-option-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aw-payment-option-header .dashicons {
    color: var(--aw-primary);
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.aw-payment-option-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--aw-gray-800);
}

.aw-payment-option-desc {
    font-size: 13px;
    color: var(--aw-gray-500);
}

.aw-payment-option-note {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--aw-gray-400);
    margin-top: 4px;
}

.aw-payment-option-note .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.aw-payment-option.selected .aw-payment-option-note {
    color: var(--aw-primary);
}

/* Balance option - KYC note styling */
.aw-payment-option[data-payment-type="balance"] .aw-note-kyc .dashicons {
    color: #d97706;
}

.aw-payment-option[data-payment-type="balance"].selected .aw-note-kyc {
    color: #d97706;
}

/* Pay Now option - No topup note styling */
.aw-payment-option[data-payment-type="pay_now"] .aw-note-no-topup .dashicons {
    color: #16a34a;
}

.aw-payment-option[data-payment-type="pay_now"].selected .aw-note-no-topup {
    color: #16a34a;
}

.aw-field-value.aw-field-value-address {
    min-height: 50px;
}

/* Responsive for payment options */
@media screen and (max-width: 600px) {
    .aw-payment-options {
        grid-template-columns: 1fr;
    }
}
