/* Main container */
.invoice-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Business type selection */
.business-type-selection {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.type-button {
    padding: 12px 24px;
    font-size: 16px;
    border: 2px solid #4CAF50;
    background: white;
    color: #4CAF50;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}


.type-button:hover {
    background: #4CAF50;
    color: white;
}

.type-button.active {
    background: #4CAF50;
    color: white;
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

select {
    height: auto;
    min-height: 42px;
    padding: 10px 8px;
    line-height: 1.4;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-select {
    width: 100%;
    padding: 10px 8px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    margin-bottom: 2px;
}

@supports (-webkit-touch-callout: none) {
    select,
    .form-select {
        font-size: 16px;
        padding: 12px 8px;
    }
}

select option {
    padding: 8px;
    min-height: 1.2em;
    line-height: 1.4;
}

/* Business search section */
.business-section {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.new-business-button {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.new-business-button:hover {
    background: #45a049;
}

/* Search results dropdown */
.search-results {
    position: absolute;
    width: calc(100% - 40px);
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-item.new-item {
    background-color: #e8f4e8;
    border-top: 1px solid #ccc;
}

.search-result-item.new-item:hover {
    background-color: #d0e8d0;
}

.search-result-item .item-name {
    font-weight: 500;
}

.search-result-item.new-item .item-name {
    color: #2e7d32;
}

/* Balance display */
.balance-section {
    background: #f8f9fa;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.amount-display {
    font-size: 1.2em;
    font-weight: 600;
    color: #2196F3;
}

.balance-due {
    color: #f44336;
}

/* Payment section */
.payment-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.payment-methods {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.payment-method-button {
    background: white;
    border: 1px solid #4CAF50;
    color: #4CAF50;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.payment-method-button.active {
    background: #4CAF50;
    color: white;
}

.payment-method-button:hover {
    background: #4CAF50;
    color: white;
}

/* Price input styling */
.price-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.price-symbol {
    position: absolute;
    left: 10px;
    color: #666;
    pointer-events: none;
    z-index: 1;
}

.price-input {
    padding-left: 25px !important;
    text-align: left !important;
    width: 100%;
}

/* Number input styling */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Signature pad */
.signature-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
}

.signature-canvas {
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    width: 100%;
    max-width: 500px;
    height: 200px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    display: block;
    margin: 0 auto;
    position: relative; /* Add this */
    transform: translateZ(0); /* Add this */
    -webkit-transform: translateZ(0); /* Add this */
}

/* Ensure proper scaling and responsiveness on mobile */
@media (max-width: 768px) {
    .signature-canvas {
        width: 100%;
        height: 180px; /* Slightly reduced for better mobile fit */
    }
}

/* Fix for older iPads (2013 and earlier) */
@media only screen 
and (min-device-width: 768px) 
and (max-device-width: 1024px) 
and (-webkit-min-device-pixel-ratio: 1) {
    .signature-canvas {
        height: 300px; /* Increased height */
        transform: scale(1, 1); /* Reset any scaling */
    }
}
/* Target iPad with iOS 7 and below */
@supports (-webkit-overflow-scrolling: touch) and (not (backdrop-filter: blur(1px))) {
    .signature-canvas {
        min-height: 400px;
        max-height: 400px;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}
.clear-button {
    margin-top: 10px;
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.clear-button:hover {
    background: #d32f2f;
}

/* Order history */
.order-history {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.order-history-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-toggle {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
}

/* Tables */
.order-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
}

.order-table th {
    background: #f5f5f5;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
}

.order-table td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.number-cell {
    text-align: right;
    font-family: monospace;
}

.price-cell {
    text-align: right;
    font-family: monospace;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.submit-button, .add-button {
    padding: 12px 24px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.submit-button:hover, .add-button:hover {
    background: #45a049;
}

.cancel-button, .delete-button {
    padding: 12px 24px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.cancel-button:hover, .delete-button:hover {
    background: #d32f2f;
}

.view-button, .email-button {
    padding: 6px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.view-button:hover, .email-button:hover {
    background: #1976D2;
}

/* Responsive design */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
    
    .payment-methods {
        flex-direction: column;
    }
    
    .payment-method-button {
        width: 100%;
    }
    
    .order-table {
        display: block;
        overflow-x: auto;
    }

    .action-buttons {
        flex-direction: column;
    }

    input, select, textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    /* Fix date input issues on mobile */
    input[type="date"] {
        font-size: 16px !important;
        padding: 12px !important;
        min-height: 44px !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        background-color: white !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Prevent zoom on iOS */
    input[type="date"]:focus {
        font-size: 16px !important;
        transform: none !important;
        transition: none !important;
    }
    
    /* Fix for date picker on mobile browsers */
    input[type="date"]::-webkit-datetime-edit {
        font-size: 16px !important;
        padding: 0 !important;
    }
    
    input[type="date"]::-webkit-calendar-picker-indicator {
        font-size: 16px !important;
        cursor: pointer !important;
    }
}
.wp-list-table {
    table-layout: fixed;
    width: 100%;
}

.wp-list-table .check-column {
    width: 40px; /* Adjust as needed */
    vertical-align: middle;
    text-align: center;
}

.wp-list-table th, .wp-list-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    word-break: break-word;
}

.wp-list-table th span.sort-indicator {
    margin-left: 5px;
}
.balance-refund-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.balance-refund-row .form-group {
    flex: 1;
}

@media (max-width: 768px) {
    .balance-refund-row {
        flex-direction: column;
        gap: 10px;
    }
}
@media (max-width: 480px) {
    .balance-refund-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .balance-refund-row .form-group {
        width: 100%;
    }
    
    .price-input-container {
        width: 100%;
    }
    
    /* Additional date input fixes for very small screens */
    input[type="date"] {
        font-size: 16px !important;
        padding: 14px !important;
        min-height: 48px !important;
        line-height: 1.2 !important;
        border-radius: 6px !important;
        background: white !important;
        color: #333 !important;
    }
    
    /* Prevent input field jumping/jittering */
    .form-group input[type="date"] {
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
    }
}
.container-input-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.multi-container-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.container-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-container-button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    height: 42px;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.add-container-button:hover {
    background-color: #3367d6;
}

.container-total {
    margin-top: 8px;
    font-weight: bold;
}

.container-list {
    font-size: 14px;
}

.container-sum {
    font-weight: bold;
    border-top: 1px solid #ddd;
    padding-top: 4px;
    margin-top: 4px;
}
/* Balance Display Styles */
.balance-due {
    color: #f44336;
}

.balance-credit {
    color: #4CAF50;
}

/* Payment Modal Styles */
.payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.payment-method-button {
    padding: 8px 16px;
    background: white;
    border: 1px solid #4CAF50;
    color: #4CAF50;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.payment-method-button.active {
    background: #4CAF50;
    color: white;
}

.input-prefix-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.input-prefix-wrapper input {
    padding-left: 20px;
    width: 100%;
}

.input-prefix-wrapper span {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
/* Admin adjustment styling */
tr.payment-record {
    background-color: #f8f8e8;
}

.payment-notes {
    font-size: 0.9em;
    max-width: 250px;
    word-wrap: break-word;
}

.payment-notes p {
    margin: 5px 0 0 0;
    font-style: italic;
    color: #555;
}

.payment-notes strong {
    color: #333;
    display: block;
}
/* Image styles for inventory items */
.item-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.item-image-preview {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    background-color: #f9f9f9;
    margin: 0 auto 15px auto;
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item img {
    margin-right: 10px;
}

.search-result-item .item-details {
    font-size: 0.85em;
    color: #666;
}

/* Image upload styles */
.image-upload-container {
    text-align: center;
    margin-bottom: 15px;
}

.image-upload-button {
    padding: 8px 16px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.image-upload-button:hover {
    background-color: #3367d6;
}

.image-preview {
    margin: 10px auto;
    max-width: 150px;
    max-height: 150px;
    display: block;
}

.remove-image-button {
    padding: 5px 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
}

.remove-image-button:hover {
    background-color: #d32f2f;
}
/* Responsive improvements for Admin Tools */
@media (max-width: 767px) {
    /* Improved table display for mobile */
    .wp-list-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Make checkbox column smaller */
    .wp-list-table .check-column {
        width: 30px;
        padding: 5px !important;
    }
    
    /* Adjust all table cells for mobile */
    .wp-list-table th, 
    .wp-list-table td {
        padding: 6px 4px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    /* Adjust filter row for mobile */
    .tablenav-pages {
        float: none;
        width: 100%;
        margin: 10px 0;
    }
    
    /* Make the filter input take full width */
    .tablenav-pages input[type="text"] {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Improve "Show Recent" filter layout */
    .tablenav-pages > div {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 10px;
    }
    
    /* Improve action buttons layout on mobile */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    /* Make buttons bigger for touch targets */
    .button {
        min-height: 40px;
        line-height: 38px;
        font-size: 14px;
        padding: 0 12px;
    }
    
    /* Fix tab navigation on mobile */
    .nav-tab-wrapper {
        display: flex;
    }
    
    .nav-tab {
        flex: 1;
        text-align: center;
        margin: 0 2px;
        padding: 8px 5px;
        font-size: 13px;
    }
    
    /* Fix modal dialogs on mobile */
    .edit-modal, 
    .payment-modal {
        width: 90% !important;
        max-width: 90% !important;
        top: 40% !important;
    }
}

/* Additional fixes for very small screens */
@media (max-width: 480px) {
    /* Further reduce font size */
    .wp-list-table th, 
    .wp-list-table td {
        font-size: 11px;
        padding: 4px 2px;
    }
    
    /* Hide less important columns on very small screens */
    .mobile-hide-column {
        display: none;
    }
    
    /* Create more space in modals */
    .edit-modal input,
    .edit-modal select,
    .payment-modal input,
    .payment-modal select {
        margin-bottom: 15px;
    }
}
/* Improved mobile display for Admin Tools buttons */
@media (max-width: 767px) {
    /* Make action buttons appear in a vertical stack on mobile */
    .alignleft.actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
        width: 100%;
    }
    
    /* Make each button take full width on mobile */
    .alignleft.actions .button {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
        text-align: center;
        min-height: 44px; /* Better touch target size */
        padding: 10px 15px;
        font-size: 16px; /* Larger text for mobile */
    }
    
    /* Adjust tablenav layout */
    .tablenav {
        display: flex;
        flex-direction: column;
    }
    
    /* Move filter to the top */
    .tablenav-pages {
        order: -1;
        margin-bottom: 15px;
    }
}
/* Mobile-specific fixes for admin toolbar buttons */
@media only screen and (max-width: 767px) {
    /* Force buttons to be visible */
    .alignleft.actions {
        display: block !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    /* Make each button appear as a block element */
    .alignleft.actions .button {
        display: block !important;
        width: 100% !important;
        margin: 10px 0 !important;
        text-align: center !important;
        padding: 12px 10px !important;
        height: auto !important;
        line-height: 1.5 !important;
        font-size: 16px !important;
        clear: both !important;
    }
    
    /* Fix for very small screens */
    .tablenav {
        height: auto !important;
        overflow: visible !important;
        clear: both !important;
    }
    
    /* Ensure filter is visible */
    .tablenav-pages {
        display: block !important;
        width: 100% !important;
        margin: 15px 0 !important;
    }
    
    /* Show more information */
    .mobile-hide-column {
        display: table-cell !important;
    }
}

/* iPhone-specific fixes */
@media only screen and (max-width: 414px) {
    /* Force the toolbar to be visible and properly laid out */
    .tablenav.top {
        display: flex !important;
        flex-direction: column !important;
        padding: 10px !important;
    }
    
    /* Ensure buttons display one per line */
    .button-primary, 
    .button-secondary {
        margin-top: 8px !important;
        margin-bottom: 8px !important;
    }
}
/* Improve modal sizing on mobile */
@media only screen and (max-width: 767px) {
    /* Make the modal better fit mobile screens */
    .edit-modal {
        width: 90% !important;
        max-width: 90% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        padding: 15px !important;
        top: 45% !important;
    }
    
    /* Adjust form elements for better mobile display */
    .edit-modal .form-wrap {
        max-height: 70vh;
        overflow-y: auto;
        padding-bottom: 15px;
    }
    
    /* Make sure buttons remain visible */
    .edit-modal .button {
        margin-top: 5px;
        margin-bottom: 5px;
        min-height: 44px;
    }
}
/* iPad-specific fixes */
@media only screen 
and (min-device-width: 768px) 
and (max-device-width: 1024px) {
    /* Ensure buttons are visible on iPads */
    .alignleft.actions {
        display: block !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    /* Make buttons more prominent */
    .alignleft.actions .button {
        display: inline-block !important;
        min-width: 120px !important;
        margin: 10px 5px !important;
        padding: 12px 10px !important;
        text-align: center !important;
        font-size: 14px !important;
    }
    
    /* Fix toolbar layout */
    .tablenav.top {
        display: block !important;
        width: 100% !important;
        clear: both !important;
        margin-bottom: 20px !important;
    }
    
    /* Fix button display */
    .button-primary, .button-secondary {
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Additional fix for newer iPads */
@media only screen 
and (min-device-width: 768px) 
and (max-device-width: 1366px)
and (-webkit-min-device-pixel-ratio: 2) {
    /* Ensure buttons are visible */
    .alignleft.actions,
    .alignleft.actions .button {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Make buttons take full width for better visibility */
    .alignleft.actions {
        width: 100% !important;
    }
    
    /* Make buttons larger and easier to tap */
    .button {
        min-height: 44px !important;
        line-height: 44px !important;
        margin: 8px 0 !important;
    }
}
/* Stronger iPad-specific fixes */
@media only screen 
and (min-device-width: 768px) 
and (max-device-width: 1366px) {
    .alignleft.actions {
        display: block !important;
        width: 100% !important;
        margin-bottom: 20px !important;
        visibility: visible !important;
        position: static !important;
    }
    
    /* Make absolutely sure buttons are visible and well-sized */
    .button-primary, 
    .button-secondary, 
    .alignleft.actions .button {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 44px !important;
        min-width: 120px !important;
        margin: 10px 5px !important;
        font-size: 16px !important;
        position: static !important;
    }
    
    /* Ensure the tablenav has proper height */
    .tablenav {
        min-height: 150px !important;
        height: auto !important;
        overflow: visible !important;
    }
}
/* Bill of Lading Styles */
.bol-checkbox {
    margin: 15px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.bol-form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
}

.bol-products {
    margin-bottom: 20px;
}

.bol-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

@media (max-width: 768px) {
    .bol-details {
        grid-template-columns: 1fr;
    }
}

/* Payment method styling for No Charge */
.payment-method-button.active[key="No Charge"] {
    background: #4CAF50;
    color: white;
}

/* Responsive improvements for BOL form */
@media (max-width: 480px) {
    .bol-products > div {
        grid-template-columns: 1fr;
    }
}
/* Improved Bill of Lading Styles */
.bol-checkbox {
    margin: 15px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.bol-form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
}

.bol-products {
    margin-bottom: 20px;
}

.bol-products > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.bol-products input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 10px;
}

.bol-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* BOL total weight styling */
.bol-total-weight {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f0f7f0;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.bol-total-weight label {
    margin-right: 10px;
    font-weight: bold;
}

.bol-total-weight input {
    width: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-weight: bold;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .bol-details {
        grid-template-columns: 1fr;
    }
    
    .bol-products > div {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .bol-products > div {
        grid-template-columns: 1fr;
    }
}
/* BOL specific table styling */
.order-table tr.bol-item td {
    background-color: #f9f9f9;
}

.order-table tr.bol-details td {
    font-style: italic;
    background-color: #f0f7f0;
}

/* Make the BOL checkbox more prominent */
.bol-checkbox label {
    font-size: 16px;
    font-weight: bold !important;
    color: #2e7d32;
}

.bol-checkbox input[type="checkbox"] {
    transform: scale(1.3) !important;
}
/* BOL Order Summary styling */
.bol-order-summary {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.bol-items-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.bol-items-table th, 
.bol-items-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.bol-items-table th {
    background-color: #f0f0f0;
    font-weight: bold;
}

.bol-items-table .weight-cell {
    text-align: right;
}

.bol-items-table .total-row {
    background-color: #f0f7f0;
}

.bol-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.bol-detail-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #f0f7f0;
    border-radius: 4px;
}

.bol-detail-label {
    font-weight: bold;
    margin-bottom: 5px;
}

.bol-comments {
    margin-top: 15px;
    padding: 10px;
    background: #f0f7f0;
    border-radius: 4px;
}
/* Tax-related styles */
.tax-row {
    background-color: #fff3cd !important;
    font-weight: bold;
}

.grand-total-row {
    background-color: #d4edda !important;
    font-weight: bold;
    border-top: 2px solid #28a745;
}

.taxable-badge {
    background-color: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
}

.tax-display {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
}

.tax-checkbox-container {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.tax-checkbox-container.checked {
    background-color: #e8f5e9;
    border-color: #a5d6a7;
}

.tax-reports-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Tax report form styles */
.tax-report-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tax-report-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tax-report-form .form-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

@media (max-width: 768px) {
    .tax-report-form .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* iOS-specific date input fixes */
@supports (-webkit-touch-callout: none) {
    input[type="date"] {
        font-size: 16px !important;
        padding: 12px !important;
        min-height: 44px !important;
        -webkit-appearance: none !important;
        appearance: none !important;
        background-color: white !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        position: relative !important;
        z-index: 1 !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        will-change: auto !important;
    }
    
    input[type="date"]:focus {
        outline: none !important;
        border-color: #4CAF50 !important;
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2) !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
    }
    
    /* Prevent the date field from jumping on iOS */
    .form-group {
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
    }
}

/* Fix for iPad date inputs */
@media only screen 
and (min-device-width: 768px) 
and (max-device-width: 1366px) {
    input[type="date"] {
        font-size: 16px !important;
        padding: 12px !important;
        min-height: 44px !important;
        -webkit-appearance: none !important;
        background: white !important;
        border: 1px solid #ddd !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
    }
    
    input[type="date"]:focus {
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
    }
}
/* Draft Management Styles */
.draft-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.draft-dialog {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.draft-management-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 8px;
    border: 1px solid #b0d4f1;
}

.draft-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.draft-table th,
.draft-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.draft-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.draft-button {
    padding: 10px 20px;
    background-color: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: background-color 0.2s;
}

.draft-button:hover {
    background-color: #1565c0;
}

.draft-button.save {
    background-color: #4caf50;
}

.draft-button.save:hover {
    background-color: #45a049;
}

.draft-button.delete {
    background-color: #f44336;
}

.draft-button.delete:hover {
    background-color: #d32f2f;
}

.draft-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Mobile responsiveness for draft dialog */
@media (max-width: 768px) {
    .draft-dialog {
        width: 95%;
        padding: 15px;
        max-height: 90vh;
    }
    
    .draft-table {
        font-size: 12px;
    }
    
    .draft-table th,
    .draft-table td {
        padding: 5px;
    }
    
    .draft-management-section {
        padding: 10px;
    }
    
    .draft-management-section h3 {
        font-size: 16px;
    }
    /* Bulk export checkbox styling */
    .order-table input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        margin: 0 auto;
        display: block;
    }

    .order-table thead input[type="checkbox"] {
        transform: scale(1.1);
    }

    /* Export button styling */
    .bulk-export-button {
        background-color: #217346;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
        transition: background-color 0.2s;
    }

    .bulk-export-button:hover {
        background-color: #1a5c38;
    }

    .bulk-export-button:disabled {
        background-color: #ccc;
        cursor: not-allowed;
    }
    /* Active Users Indicator Animation */
    @keyframes pulse {
        0%, 100% {
            opacity: 1;
            transform: scale(1);
        }
        50% {
            opacity: 0.6;
            transform: scale(1.2);
        }
    }
}
/* Print styles for invoice modal */
@media print {
    body * {
        visibility: hidden;
    }
    
    #invoice-modal-printable,
    #invoice-modal-printable * {
        visibility: visible;
    }
    
    #invoice-modal-printable {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        padding: 20px;
        box-shadow: none;
        border-radius: 0;
    }
    
    .no-print {
        display: none !important;
    }
    
    .invoice-modal-overlay {
        background: none !important;
        position: static !important;
    }
}