/**
 * PO Creation System - Modern CSS Styles with Supplier Search
 * Blue and Orange Color Scheme with Responsive Design
 */

/* CSS Variables for consistent theming */
:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --primary-blue-light: #3b82f6;
    --primary-orange: #ea580c;
    --primary-orange-dark: #c2410c;
    --primary-orange-light: #f97316;
    --bg-white: #ffffff;
    --bg-gray-50: #f9fafb;
    --bg-gray-100: #f3f4f6;
    --text-gray-900: #111827;
    --text-gray-700: #374151;
    --text-gray-500: #6b7280;
    --border-gray-200: #e5e7eb;
    --border-gray-300: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --transition: all 0.2s ease-in-out;
}

/* Main Form Container */
.sj-pur-form-xy25 {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.po-form-xy25 {
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-gray-900);
}

/* Header Section */
.po-header-xy25 {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-gray-200);
}

.po-header-xy25 h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

/* Form Sections */
.po-info-section-xy25,
.po-supplier-section-xy25,
.po-products-section-xy25,
.po-total-section-xy25,
.po-submit-section-xy25 {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-gray-200);
}

.po-submit-section-xy25 {
    border-bottom: none;
    background: var(--bg-gray-50);
}

/* Supplier Section */
.po-supplier-section-xy25 {
    background: var(--bg-gray-50);
}

.po-supplier-section-xy25 .section-header-xy25 h4 {
    color: var(--primary-orange);
    display: flex;
    align-items: center;
    gap: 8px;
}

.po-supplier-section-xy25 .section-header-xy25 h4::before {
    content: "🏢";
    font-size: 20px;
}

/* Form Layout */
.form-row-xy25 {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.form-group-xy25 {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.col-6-xy25 {
    flex: 1;
    min-width: 250px;
}

/* Form Controls */
.form-group-xy25 label {
    font-weight: 600;
    color: var(--text-gray-700);
    margin-bottom: 6px;
    font-size: 14px;
}

.form-control-xy25 {
    padding: 12px 16px;
    border: 2px solid var(--border-gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-white);
    min-height: 44px;
    box-sizing: border-box;
}

.form-control-xy25:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-control-xy25:read-only {
    background: var(--bg-gray-100);
    color: var(--text-gray-500);
    cursor: not-allowed;
}

.form-control-xy25::placeholder {
    color: var(--text-gray-500);
}

/* Supplier Search Container */
.supplier-search-container-xy25 {
    position: relative;
    width: 100%;
}

.supplier-search-xy25 {
    width: 100%;
    padding-right: 40px;
}

.supplier-search-xy25:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgb(234 88 12 / 0.1);
}

/* Supplier Address Textarea */
.supplier-address-xy25 {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    background: var(--bg-gray-100);
    border: 2px dashed var(--border-gray-300);
    transition: var(--transition);
}

.supplier-address-xy25:not(:read-only) {
    background: var(--bg-white);
    border-style: solid;
}

.supplier-address-xy25.filled-xy25 {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.05) 0%, rgba(234, 88, 12, 0.1) 100%);
    border-color: var(--primary-orange);
    color: var(--text-gray-900);
    font-weight: 500;
}

/* Supplier Autocomplete Dropdown */
.supplier-autocomplete-dropdown-xy25 {
    position: fixed;
    background: var(--bg-white);
    border: 2px solid var(--primary-orange);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgb(0 0 0 / 0.15), 0 4px 12px rgb(0 0 0 / 0.1);
    z-index: 9999;
    max-height: 300px;
    min-width: 350px;
    overflow-y: auto;
    display: none;
    backdrop-filter: blur(10px);
}

.supplier-autocomplete-dropdown-xy25.show-xy25 {
    display: block;
    animation: supplierDropdownSlideIn 0.2s ease-out;
}

@keyframes supplierDropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.supplier-autocomplete-item-xy25 {
    padding: 20px 24px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-gray-200);
    transition: all 0.15s ease-in-out;
    position: relative;
    display: block;
    user-select: none;
    min-height: 80px;
}

.supplier-autocomplete-item-xy25:hover,
.supplier-autocomplete-item-xy25.active-xy25 {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-orange-light) 100%);
    color: white;
    transform: translateX(4px);
}

.supplier-autocomplete-item-xy25:hover .supplier-name-text-xy25,
.supplier-autocomplete-item-xy25.active-xy25 .supplier-name-text-xy25 {
    color: white;
    font-weight: 700;
}

.supplier-autocomplete-item-xy25:hover .supplier-address-text-xy25,
.supplier-autocomplete-item-xy25.active-xy25 .supplier-address-text-xy25 {
    color: rgba(255, 255, 255, 0.9);
}

.supplier-autocomplete-item-xy25:hover .supplier-country-text-xy25,
.supplier-autocomplete-item-xy25.active-xy25 .supplier-country-text-xy25 {
    color: rgba(255, 255, 255, 0.8);
}

.supplier-autocomplete-item-xy25:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.supplier-autocomplete-item-xy25:first-child {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.supplier-autocomplete-item-xy25.no-results-xy25 {
    cursor: default;
    color: var(--text-gray-500);
    font-style: italic;
    text-align: center;
    background: var(--bg-gray-50);
    min-height: auto;
}

.supplier-autocomplete-item-xy25.no-results-xy25:hover {
    background: var(--bg-gray-50);
    transform: none;
    color: var(--text-gray-500);
}

.supplier-autocomplete-loading-xy25,
.supplier-autocomplete-error-xy25 {
    padding: 20px 24px;
    text-align: center;
    color: var(--text-gray-500);
    font-style: italic;
    background: var(--bg-gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.supplier-autocomplete-error-xy25 {
    color: #dc2626;
}

.supplier-name-text-xy25 {
    font-weight: 700;
    color: var(--primary-orange);
    font-size: 16px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supplier-name-text-xy25::before {
    content: "🏢";
    font-size: 14px;
}

.supplier-address-text-xy25 {
    color: var(--text-gray-700);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
    display: block;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.supplier-country-text-xy25 {
    color: var(--text-gray-500);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.supplier-country-text-xy25::before {
    content: "🌍";
    font-size: 10px;
}

.no-supplier-results-text-xy25 {
    color: var(--text-gray-500);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.no-supplier-results-text-xy25::before {
    content: "🔍";
    font-size: 16px;
}

/* Enhanced scrollbar styling for supplier dropdown */
.supplier-autocomplete-dropdown-xy25::-webkit-scrollbar {
    width: 8px;
}

.supplier-autocomplete-dropdown-xy25::-webkit-scrollbar-track {
    background: var(--bg-gray-100);
    border-radius: 4px;
}

.supplier-autocomplete-dropdown-xy25::-webkit-scrollbar-thumb {
    background: var(--primary-orange);
    border-radius: 4px;
    opacity: 0.7;
}

.supplier-autocomplete-dropdown-xy25::-webkit-scrollbar-thumb:hover {
    background: var(--primary-orange-dark);
    opacity: 1;
}

/* Supplier search input enhancement when focused */
.supplier-search-xy25:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgb(234 88 12 / 0.1);
    background: var(--bg-white);
}

/* Selection success animation for supplier */
.supplier-search-xy25.selected-xy25 {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgb(34 197 94 / 0.2);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(34, 197, 94, 0.1) 100%);
    animation: supplierSelectionPulse 0.6s ease-out;
}

@keyframes supplierSelectionPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 3px rgb(34 197 94 / 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 6px rgb(34 197 94 / 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 3px rgb(34 197 94 / 0.2);
    }
}

/* Loading state for supplier search input */
.supplier-search-xy25.searching-xy25 {
    background-image: linear-gradient(45deg, transparent 25%, rgba(234, 88, 12, 0.1) 25%, rgba(234, 88, 12, 0.1) 50%, transparent 50%, transparent 75%, rgba(234, 88, 12, 0.1) 75%);
    background-size: 20px 20px;
    animation: supplierSearchingStripes 1s linear infinite;
    border-color: var(--primary-orange);
}

@keyframes supplierSearchingStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

/* Success indicator for supplier selection */
.supplier-selection-success-xy25 {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    color: #22c55e;
    font-size: 18px;
    z-index: 10;
    animation: supplierSelectionSuccess 1.5s ease-out;
}

@keyframes supplierSelectionSuccess {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    30% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
    70% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
}

/* Date Input Group */
.date-input-group-xy25 {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-buttons-xy25 {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.date-btn-xy25 {
    padding: 6px 12px;
    border: 1px solid var(--primary-orange);
    background: var(--bg-white);
    color: var(--primary-orange);
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 40px;
}

.date-btn-xy25:hover {
    background: var(--primary-orange);
    color: white;
    transform: translateY(-1px);
}

/* Products Section */
.section-header-xy25 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header-xy25 h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-gray-900);
}

.btn-add-xy25 {
    padding: 10px 20px;
    background: var(--primary-orange);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add-xy25:hover {
    background: var(--primary-orange-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Products Table */
.products-table-xy25 {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: visible;
    border: 1px solid var(--border-gray-200);
    position: relative;
}

.table-header-xy25 {
    display: grid;
    grid-template-columns: 60px 1fr 2fr 120px 100px 80px 80px 100px 120px 60px;
    gap: 8px;
    padding: 16px;
    background: var(--bg-gray-100);
    font-weight: 700;
    color: var(--text-gray-700);
    font-size: 13px;
    border-bottom: 2px solid var(--border-gray-200);
    align-items: center;
}

.product-row-xy25 {
    display: grid;
    grid-template-columns: 60px 1fr 2fr 120px 100px 80px 80px 100px 120px 60px;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--border-gray-200);
    align-items: center;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.product-row-xy25:hover {
    background: var(--bg-gray-50);
}

.product-row-xy25:last-child {
    border-bottom: none;
}

.product-row-xy25:has(.autocomplete-dropdown-xy25.show-xy25) {
    z-index: 10000;
}

/* Product Row Elements */
.row-number-xy25 {
    text-align: center;
    font-weight: 600;
    color: var(--text-gray-500);
    font-size: 14px;
}

.product-row-xy25 .form-control-xy25 {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
}

.product-amount-xy25 {
    text-align: right;
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 14px;
    padding: 8px 12px;
    background: var(--bg-gray-50);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    position: relative;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.product-amount-xy25.calculating-xy25 {
    background: var(--primary-orange-light);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.product-amount-xy25.zero-amount-xy25 {
    color: var(--text-gray-500);
    background: var(--bg-gray-100);
}

.product-amount-xy25.positive-amount-xy25 {
    color: var(--primary-blue);
    background: linear-gradient(135deg, var(--bg-gray-50) 0%, rgba(37, 99, 235, 0.05) 100%);
}

/* Enhanced total display */
.total-amount-xy25 {
    color: var(--primary-blue);
    font-size: 24px;
    min-width: 150px;
    text-align: right;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    font-weight: 700;
}

.total-amount-xy25.updating-xy25 {
    animation: totalUpdate 0.5s ease-out;
}

.total-amount-xy25.zero-total-xy25 {
    color: var(--text-gray-500);
}

.total-amount-xy25.positive-total-xy25 {
    color: var(--primary-blue);
}

@keyframes totalUpdate {
    0% {
        transform: scale(1);
        background: transparent;
    }
    50% {
        transform: scale(1.05);
        background: var(--primary-orange-light);
        color: white;
        border-radius: var(--border-radius-sm);
        padding: 4px 8px;
    }
    100% {
        transform: scale(1);
        background: transparent;
    }
}

/* LOT column styling */
.col-lot-xy25 {
    min-width: 120px;
}

.product-lot-xy25 {
    text-align: center;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

/* Enhanced input styling for numeric fields */
.product-price-xy25,
.product-discount-xy25,
.product-quantity-xy25 {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.product-price-xy25::placeholder,
.product-discount-xy25::placeholder,
.product-quantity-xy25::placeholder {
    text-align: right;
    font-family: inherit;
}

/* Input correction feedback */
.form-control-xy25.corrected-xy25 {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgb(234 88 12 / 0.2);
    animation: correctionFlash 1s ease-out;
}

@keyframes correctionFlash {
    0% {
        background: var(--primary-orange-light);
        color: white;
    }
    100% {
        background: var(--bg-white);
        color: var(--text-gray-900);
    }
}

/* Date input enhancements */
.form-control-xy25[type="date"]:not([readonly]) {
    cursor: pointer;
}

.form-control-xy25[type="date"]:not([readonly]):hover {
    border-color: var(--primary-blue);
}

.form-control-xy25.invalid-xy25 {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgb(220 38 38 / 0.1);
}

/* Currency display improvements */
.currency-xy25 {
    color: var(--text-gray-700);
    font-weight: 600;
    font-size: 16px;
}

.btn-remove-xy25 {
    width: 32px;
    height: 32px;
    border: none;
    background: #dc2626;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin: 0 auto;
}

.btn-remove-xy25:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

/* Product Autocomplete - Enhanced UI */
.col-code-xy25 {
    position: relative;
}

.autocomplete-dropdown-xy25 {
    position: fixed;
    background: var(--bg-white);
    border: 2px solid var(--primary-blue);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgb(0 0 0 / 0.15), 0 4px 12px rgb(0 0 0 / 0.1);
    z-index: 9999;
    max-height: 300px;
    min-width: 300px;
    overflow-y: auto;
    display: none;
    backdrop-filter: blur(10px);
}

.autocomplete-dropdown-xy25.show-xy25 {
    display: block;
    animation: dropdownSlideIn 0.2s ease-out;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.autocomplete-item-xy25 {
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-gray-200);
    transition: all 0.15s ease-in-out;
    position: relative;
    display: block;
    user-select: none;
    min-height: 60px;
}

.autocomplete-item-xy25:hover,
.autocomplete-item-xy25.active-xy25 {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    color: white;
    transform: translateX(4px);
}

.autocomplete-item-xy25:hover .product-code-text-xy25,
.autocomplete-item-xy25.active-xy25 .product-code-text-xy25 {
    color: white;
    font-weight: 700;
}

.autocomplete-item-xy25:hover .product-name-text-xy25,
.autocomplete-item-xy25.active-xy25 .product-name-text-xy25 {
    color: rgba(255, 255, 255, 0.9);
}

.autocomplete-item-xy25:hover .product-id-text-xy25,
.autocomplete-item-xy25.active-xy25 .product-id-text-xy25 {
    color: rgba(255, 255, 255, 0.7);
}

.autocomplete-item-xy25:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.autocomplete-item-xy25:first-child {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.autocomplete-item-xy25.no-results-xy25 {
    cursor: default;
    color: var(--text-gray-500);
    font-style: italic;
    text-align: center;
    background: var(--bg-gray-50);
    min-height: auto;
}

.autocomplete-item-xy25.no-results-xy25:hover {
    background: var(--bg-gray-50);
    transform: none;
    color: var(--text-gray-500);
}

.autocomplete-loading-xy25,
.autocomplete-error-xy25 {
    padding: 16px 20px;
    text-align: center;
    color: var(--text-gray-500);
    font-style: italic;
    background: var(--bg-gray-50);
}

.autocomplete-error-xy25 {
    color: #dc2626;
}

.product-code-text-xy25 {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 14px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.product-name-text-xy25 {
    color: var(--text-gray-700);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 2px;
}

.product-id-text-xy25 {
    color: var(--text-gray-500);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.no-results-text-xy25 {
    color: var(--text-gray-500);
    font-size: 14px;
}

/* Enhanced scrollbar styling */
.autocomplete-dropdown-xy25::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown-xy25::-webkit-scrollbar-track {
    background: var(--bg-gray-100);
    border-radius: 4px;
}

.autocomplete-dropdown-xy25::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
    opacity: 0.7;
}

.autocomplete-dropdown-xy25::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue-dark);
    opacity: 1;
}

/* Search input enhancement when focused */
.product-code-xy25:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
    background: var(--bg-white);
}

/* Selection success animation */
.product-code-xy25.selected-xy25,
.product-name-xy25.selected-xy25 {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgb(34 197 94 / 0.2);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(34, 197, 94, 0.1) 100%);
    animation: selectionPulse 0.6s ease-out;
}

@keyframes selectionPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 3px rgb(34 197 94 / 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 6px rgb(34 197 94 / 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 3px rgb(34 197 94 / 0.2);
    }
}

@keyframes selectionSuccess {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) scale(1);
    }
}

/* Loading state for product code input */
.product-code-xy25.searching-xy25 {
    background-image: linear-gradient(45deg, transparent 25%, rgba(37, 99, 235, 0.1) 25%, rgba(37, 99, 235, 0.1) 50%, transparent 50%, transparent 75%, rgba(37, 99, 235, 0.1) 75%);
    background-size: 20px 20px;
    animation: searchingStripes 1s linear infinite;
    border-color: var(--primary-blue);
}

@keyframes searchingStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

/* Total Section */
.po-total-section-xy25 {
    background: var(--bg-gray-50);
}

.total-row-xy25 {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
}

.currency-xy25 {
    color: var(--text-gray-700);
}

/* Submit Section */
.btn-submit-xy25 {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-submit-xy25:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-submit-xy25:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading-xy25 {
    text-align: center;
    color: var(--text-gray-500);
    font-style: italic;
    margin-top: 12px;
}

/* Messages */
.sj-message-xy25 {
    padding: 16px 24px;
    margin-bottom: 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    animation: slideDown 0.3s ease-out;
}

.sj-message-success-xy25 {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.sj-message-error-xy25 {
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #ef4444;
}

.sj-message-warning-xy25 {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.sj-message-info-xy25 {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Enhanced message styling */
.message-content-xy25 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-icon-xy25 {
    font-size: 18px;
    flex-shrink: 0;
}

.message-text-xy25 {
    flex: 1;
}

.message-close-xy25 {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.6;
    transition: var(--transition);
}

.message-close-xy25:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .table-header-xy25,
    .product-row-xy25 {
        grid-template-columns: 50px 1fr 1.5fr 100px 90px 70px 70px 90px 100px 50px;
        gap: 6px;
    }
    
    .po-info-section-xy25,
    .po-supplier-section-xy25,
    .po-products-section-xy25,
    .po-total-section-xy25,
    .po-submit-section-xy25 {
        padding: 20px 24px;
    }
    
    .po-header-xy25 {
        padding: 20px 24px;
    }
    
    .supplier-autocomplete-dropdown-xy25 {
        min-width: 320px;
    }
}

@media (max-width: 768px) {
    .sj-pur-form-xy25 {
        margin: 0 16px;
    }
    
    .form-row-xy25 {
        flex-direction: column;
        gap: 12px;
    }
    
    .col-6-xy25 {
        min-width: 100%;
    }
    
    .date-buttons-xy25 {
        justify-content: center;
    }
    
    .table-header-xy25,
    .product-row-xy25 {
        display: none;
    }
    
    .products-table-xy25 {
        overflow: visible;
    }
    
    .product-row-xy25 {
        display: block;
        border: 2px solid var(--border-gray-200);
        border-radius: var(--border-radius);
        margin-bottom: 16px;
        padding: 16px;
        background: var(--bg-white);
    }
    
    .product-row-xy25 > div {
        margin-bottom: 12px;
    }
    
    .product-row-xy25 > div:last-child {
        margin-bottom: 0;
    }
    
    .product-row-xy25 > div::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-gray-700);
        display: block;
        margin-bottom: 4px;
        font-size: 13px;
    }
    
    .col-order-xy25::before { content: "ลำดับ: "; }
    .col-code-xy25::before { content: "รหัสสินค้า: "; }
    .col-name-xy25::before { content: "ชื่อรายการ: "; }
    .col-lot-xy25::before { content: "เลข LOT: "; }
    .col-price-xy25::before { content: "ราคา: "; }
    .col-discount-xy25::before { content: "ส่วนลด %: "; }
    .col-qty-xy25::before { content: "จำนวน: "; }
    .col-unit-xy25::before { content: "หน่วยนับ: "; }
    .col-amount-xy25::before { content: "มูลค่ารวม: "; }
    
    .row-number-xy25 {
        text-align: left;
        font-size: 16px;
    }
    
    .product-amount-xy25 {
        text-align: left;
        font-size: 16px;
        justify-content: flex-start;
    }
    
    .btn-remove-xy25 {
        width: 100%;
        height: 40px;
        border-radius: var(--border-radius-sm);
        margin-top: 8px;
    }
    
    .total-row-xy25 {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .total-amount-xy25 {
        font-size: 20px;
        text-align: left;
        min-width: auto;
    }
    
    .section-header-xy25 {
        flex-direction: column;
        align-items: stretch;
    }
    
    .po-info-section-xy25,
    .po-supplier-section-xy25,
    .po-products-section-xy25,
    .po-total-section-xy25,
    .po-submit-section-xy25 {
        padding: 16px 20px;
    }
    
    .po-header-xy25 {
        padding: 16px 20px;
    }
    
    .po-header-xy25 h3 {
        font-size: 20px;
    }
    
    /* Mobile autocomplete adjustments */
    .autocomplete-dropdown-xy25,
    .supplier-autocomplete-dropdown-xy25 {
        position: fixed;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px);
        min-width: auto;
    }
    
    .autocomplete-item-xy25,
    .supplier-autocomplete-item-xy25 {
        padding: 20px 16px;
        min-height: 70px;
    }
    
    .product-code-text-xy25,
    .supplier-name-text-xy25 {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .product-name-text-xy25,
    .supplier-address-text-xy25 {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .product-id-text-xy25,
    .supplier-country-text-xy25 {
        font-size: 12px;
    }
    
    /* Supplier section mobile specific */
    .supplier-address-xy25 {
        min-height: 100px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .sj-pur-form-xy25 {
        margin: 0 8px;
    }
    
    .date-buttons-xy25 {
        grid-template-columns: repeat(4, 1fr);
        display: grid;
        gap: 6px;
    }
    
    .date-btn-xy25 {
        min-width: auto;
    }
    
    .po-info-section-xy25,
    .po-supplier-section-xy25,
    .po-products-section-xy25,
    .po-total-section-xy25,
    .po-submit-section-xy25 {
        padding: 12px 16px;
    }
    
    .po-header-xy25 {
        padding: 12px 16px;
    }
    
    .po-header-xy25 h3 {
        font-size: 18px;
    }
    
    .supplier-address-xy25 {
        min-height: 120px;
    }
}

/* Accessibility Improvements */
.form-control-xy25:focus,
.btn-add-xy25:focus,
.btn-submit-xy25:focus,
.btn-remove-xy25:focus,
.date-btn-xy25:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-gray-200: #000000;
        --border-gray-300: #000000;
        --text-gray-500: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .btn-add-xy25,
    .btn-remove-xy25,
    .btn-submit-xy25,
    .date-buttons-xy25,
    .loading-xy25 {
        display: none !important;
    }
    
    .sj-pur-form-xy25 {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .po-header-xy25 {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
}