/* ================================
   PO LIST SECTION
================================ */
#po_list_section {
    position: relative;
}

.po-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 200px;
    height: 40px;
    background: #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #4CAF50;
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 92px;
    height: 32px;
    background: white;
    border-radius: 20px;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(100px);
    color: #4CAF50;
}

.toggle-labels {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    padding: 0 15px;
    color: #666;
    font-size: 13px;
    font-weight: 500;
}

.toggle-switch.active .toggle-labels {
    color: white;
}

/* PO List Container with Scroll */
#po_list_container_wrapper {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

#po_list_container_wrapper::-webkit-scrollbar {
    width: 8px;
}

#po_list_container_wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#po_list_container_wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#po_list_container_wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Shimmer Effect */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    height: 20px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ================================
   TAB FORMS STYLING
================================ */
.form-view-mode input,
.form-view-mode select,
.form-view-mode textarea {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    cursor: not-allowed;
}

.form-edit-mode input,
.form-edit-mode select,
.form-edit-mode textarea {
    background-color: white !important;
    border: 1px solid #ced4da !important;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

/* ================================
   DATA TABLES (Banking, Delivery)
================================ */
.data-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.data-table-wrapper table {
    margin-bottom: 0;
}

/* Payment Summary Box */
.payment-summary-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.payment-summary-box .d-flex {
    font-size: 15px;
}

.payment-summary-box .fw-bold {
    font-size: 18px;
}

/* ================================
   DELIVERY TAB
================================ */
#delivery_table_wrapper {
    margin-bottom: 20px;
}

#delivery_history_table {
    width: 100%;
}

/* ================================
   COMPLETE ORDER BUTTON
================================ */
#order_closed_btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    font-weight: bold;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

#order_closed_btn:disabled {
    background: #6c757d;
    box-shadow: none;
    cursor: not-allowed;
}

#order_closed_btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

/* ================================
   SUCCESS TOAST (Confetti Effect)
================================ */
#successToast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 50px;
    border-radius: 15px;
    font-size: 28px;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s ease;
    opacity: 0;
}

#successToast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    .toggle-switch {
        width: 160px;
        height: 35px;
    }

    .toggle-slider {
        width: 75px;
        height: 27px;
        font-size: 11px;
    }

    .toggle-switch.active .toggle-slider {
        transform: translateX(78px);
    }
}

/* ================================
   CONDITIONAL FIELD VISIBILITY
================================ */
.conditional-field {
    display: none;
}

.conditional-field.show {
    display: flex;
}

/* ================================
   SECTION DIVIDER
================================ */
.section-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 25px 0;
}

/* ================================
   FORM CARD STYLING
================================ */
.form-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-card h6 {
    color: #495057;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

/* ================================
   UTILITY CLASSES
================================ */
.pointer {
    cursor: pointer;
}

.text-nowrap {
    white-space: nowrap;
}

.bg-light-gradient {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

input[type="radio"]:checked+label {
    color: #fdfdfd !important;
    transition: 0.2s;
}

.form-check-input:checked {
    background-color: #ffffff !important;
    border-color: #a402b5 !important;
}

/* Add this to your main CSS file (e.g., bank_shipping.css) */
.btn-group .btn-check:checked+.btn {
    /* Use a distinct color for selection (Purple/Primary) */
    background-color: #6f42c1;
    /* Purple */
    color: #fff;
    border-color: #6f42c1;
    box-shadow: 0 0 0 0.25rem rgba(111, 66, 193, 0.5);
    /* Soft highlight */
}

.btn-group .btn-check:checked+.btn:hover {
    background-color: #5935a4;
}

/* ============================================================
   E-WAY BILL STYLES - Add to bank_shipping.css
   ============================================================ */

/* Modal Styles */
#ewayBillModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
}

#ewayBillModal .modal-header .modal-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

#ewayBillModal .modal-body {
    padding: 25px;
}

/* Input Styles */
#ewayBillModal input:focus,
#ewayBillModal select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#ewayBillModal .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#ewayBillModal .form-label i {
    color: #667eea;
}

#ewayBillModal .form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 5px;
}

/* JSON Preview */
#eway_preview {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#eway_json_content {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #d4d4d4;
}

/* JSON Syntax Highlighting (optional enhancement) */
#eway_json_content .json-key {
    color: #9cdcfe;
}

#eway_json_content .json-string {
    color: #ce9178;
}

#eway_json_content .json-number {
    color: #b5cea8;
}

/* Loading Spinner */
#eway_loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Alert Messages */
#ewayBillModal .alert {
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#ewayBillModal .alert i {
    font-size: 1.2rem;
}

/* Buttons */
.btn-generate-eway {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-generate-eway:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
    color: white;
}

.btn-generate-eway:active {
    transform: translateY(0);
}

#eway_generate_btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.3s ease;
}

#eway_generate_btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#eway_generate_btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#eway_download_btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    transition: all 0.3s ease;
}

#eway_download_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

/* Modal Footer */
#ewayBillModal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 15px 25px;
}

/* Table Badge Styles for E-Way Bill Status */
.table td .badge {
    font-size: 0.75rem;
    padding: 5px 10px;
    font-weight: 500;
}

.table td .badge i {
    margin-right: 4px;
}

/* Tooltip for E-Way Bill Badge */
.table td .badge[title] {
    cursor: help;
}

/* Vehicle Number Input - Auto Uppercase */
#eway_vehicle_no {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    #ewayBillModal .modal-dialog {
        margin: 10px;
    }

    #ewayBillModal .modal-body {
        padding: 15px;
    }

    #eway_json_content {
        font-size: 10px;
    }
}

/* Info Alert Styling */
#ewayBillModal .alert-info {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #0d47a1;
}

#ewayBillModal .alert-info strong {
    color: #1565c0;
}

/* Success Alert Animation */
#eway_success {
    animation: successPulse 0.5s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error Alert Animation */
#eway_error {
    animation: errorShake 0.5s ease-out;
}

@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Delivery Summary Table Enhancement */
.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* Button Group in Actions Column */
.table td.text-nowrap .btn {
    margin-right: 5px;
}

.table td.text-nowrap .btn:last-child {
    margin-right: 0;
}

/* Loading State for Generate Button */
#eway_generate_btn.loading {
    position: relative;
    color: transparent;
}

#eway_generate_btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* JSON Preview Container Enhancement */
#eway_preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

#eway_preview label {
    color: #495057;
    margin-bottom: 10px;
}

/* Dark Mode JSON Container */
#eway_preview>div {
    background: #1e1e1e;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Scrollbar Styling for JSON Preview */
#eway_preview>div::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#eway_preview>div::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

#eway_preview>div::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

#eway_preview>div::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Mobile Optimizations */
@media (max-width: 576px) {
    .table td.text-nowrap .btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .table td .badge {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    #ewayBillModal .row .col-md-6 {
        margin-bottom: 15px;
    }
}

/* FORCE VISIBILITY FOR SHIPPING RADIO BUTTONS */

/* Unselected State: White background, Black text */
#shipping_form .btn-group label.btn {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #ced4da !important;
    font-weight: 500;
    opacity: 1 !important;
}

/* Selected State: Blue background, White text */
#shipping_form .btn-group input[type="radio"]:checked+label.btn {
    background-color: #0d6efd !important;
    /* Bright Blue */
    color: #ffffff !important;
    /* White Text */
    border-color: #0d6efd !important;
    font-weight: 700;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

/* Fix for hovered items */
#shipping_form .btn-group label.btn:hover {
    background-color: #f8f9fa !important;
    border-color: #adadad !important;
}

/* --- FIX RADIO BUTTON VISIBILITY --- */

/* 1. Container for the buttons */
.toggle-group {
    display: flex;
    gap: 0;
    /* No gap between buttons */
}

/* 2. Hide the actual radio circle */
.toggle-group .btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

/* 3. The Label (The visible button) */
.toggle-group label.btn {
    flex: 1;
    /* Equal width */
    text-align: center;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #ced4da;
    background-color: #fff !important;
    /* Force White Background */
    color: #333 !important;
    /* Force Dark Text */
    border-radius: 0;
    opacity: 1 !important;
    margin: 0;
}

/* 4. Rounded corners for first and last items */
.toggle-group label.btn:first-of-type {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.toggle-group label.btn:last-of-type {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* 5. SELECTED STATE (Active) */
.toggle-group .btn-check:checked+label.btn {
    background-color: #0d6efd !important;
    /* Bright Blue */
    color: #ffffff !important;
    /* White Text */
    border-color: #0d6efd !important;
    z-index: 2;
}

/* 6. Hover State */
.toggle-group label.btn:hover {
    background-color: #f8f9fa !important;
    border-color: #adb5bd !important;
}

/* ================================
   PLACEHOLDER STYLING
================================ */
#details_placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    border: 2px dashed #dee2e6;
}

#details_placeholder img {
    opacity: 0.4;
    filter: grayscale(100%);
}

#details_placeholder h5 {
    color: #6c757d;
    font-weight: 600;
    margin-top: 20px;
}

#details_placeholder p {
    color: #adb5bd;
    font-size: 0.9rem;
}

/* ================================
   CARD & FORM STYLING
================================ */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.form-control,
.form-select {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ================================
   PO LIST SECTION - NEW DESIGN
================================ */
.po-list-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
}

.po-list-item:hover {
    background-color: #f8f9fa;
    border-left-color: #0d6efd;
}

.po-list-item.active {
    background-color: #e7f1ff;
    border-left-color: #0d6efd;
    box-shadow: inset 0 0 0 1px #c8e0ff;
}

.po-list-item:last-child {
    border-bottom: none;
}

/* Scrollbar Styling */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Tab Styling */
.nav-tabs .nav-link {
    font-size: 0.89rem;
    color: #000000;
    border: none;
    padding: 8px 12px;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom: 2px solid #0d6efd;
    background: transparent;
    font-weight: 600;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #0d6efd;
}

/* ================================
   LAYOUT FIX - MATCH SCREENSHOT 2
================================ */

/* Hide PO Detail Section by default */
#po_detail_section {
    display: none;
}

/* Main container layout */
.container {
    max-width: 100%;
    padding: 15px;
}

/* Left sidebar - PO List */
.col-lg-3.col-md-4 {
    max-width: 350px;
    flex: 0 0 350px;
}

/* Right content area */
.col-md-20 {
    flex: 1;
    max-width: calc(100% - 370px);
}

/* PO List Container Height */
.card-body.custom-scroll {
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

/* Firm Filter Dropdown Styling */
#firmFilter {
    font-size: 0.875rem;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
}

#firmFilter:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Tab Navigation Styling */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: #6c757d;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #0d6efd;
    background: #f8f9fa;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    background-color: transparent;
    border-color: transparent transparent #0d6efd;
    font-weight: 600;
}

/* Active/Completed Tabs Specific Styling */
#poListTabs {
    margin-bottom: 0;
    border: none;
}

#poListTabs .nav-link {
    border-radius: 6px 6px 0 0;
    padding: 8px 12px;
    font-size: 0.85rem;
}

#poListTabs .nav-link.active {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-bottom: 2px solid #ffffff;
    color: #0d6efd;
}

/* PO List Items */
.po-list-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
}

.po-list-item:hover {
    background-color: #f8f9fa;
    border-left-color: #0d6efd;
}

.po-list-item.active {
    background-color: #e7f1ff;
    border-left-color: #0d6efd;
    box-shadow: inset 0 0 0 1px #c8e0ff;
}

.po-list-item:last-child {
    border-bottom: none;
}

/* Placeholder styling */
#details_placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
}

#details_placeholder img {
    opacity: 0.4;
    filter: grayscale(100%);
}

#details_placeholder h5 {
    color: #6c757d;
    font-weight: 600;
    margin-top: 20px;
}

#details_placeholder p {
    color: #adb5bd;
    font-size: 0.9rem;
}

/* Card styling */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin-bottom: 20px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    padding: 15px;
}

/* Search Box Styling */
.input-group {
    margin-bottom: 10px;
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-right: none;
    padding: 6px 10px;
}

#global_search {
    border-left: none;
    font-size: 0.875rem;
    padding: 6px 10px;
}

#global_search:focus {
    border-color: #dee2e6;
    box-shadow: none;
}

/* Pagination Styling */
#po_pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
}

#po_pagination button {
    font-size: 0.8rem;
    padding: 4px 12px;
}

#po_pagination .text-muted {
    font-size: 0.8rem;
}

/* Loader Styling */
#po_loader {
    padding: 40px 0;
    text-align: center;
}

#po_loader .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .col-lg-3.col-md-4 {
        max-width: 100%;
        flex: 0 0 100%;
        margin-bottom: 20px;
    }

    .col-md-20 {
        max-width: 100%;
        flex: 0 0 100%;
    }
}

/* Upload Document Box */
.card.mt-3 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card.mt-3 .card-body {
    padding: 15px;
}

.card.mt-3 h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

/* Create New PO Button */
.btn-primary.w-100.mb-3 {
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.btn-primary.w-100.mb-3:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* ================================
   PLACEHOLDER STYLING (Enhanced)
================================ */
#details_placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transition: all 0.3s ease;
}

#details_placeholder:hover {
    border-color: #c8d1dc;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

#details_placeholder img {
    opacity: 0.4;
    filter: grayscale(100%);
    animation: floatImage 3s ease-in-out infinite;
}

@keyframes floatImage {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

#details_placeholder h5 {
    color: #6c757d;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
}

#details_placeholder p {
    color: #adb5bd;
    font-size: 0.95rem;
    max-width: 400px;
    text-align: center;
    line-height: 1.6;
}

/* ================================
   PO DETAIL CARD (Hidden by default)
================================ */
#po_detail_card {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   LAYOUT FIX - Side by Side
================================ */

/* Full width container */
.container-fluid {
    max-width: 100%;
    padding: 15px;
}

/* Left sidebar - Fixed width */
.col-lg-3.col-md-4 {
    max-width: 350px;
    flex: 0 0 350px;
}

/* Right content area - Flexible */
.col-md-9 {
    flex: 1;
    max-width: calc(100% - 370px);
}

/* PO List Container Height */
.card-body.custom-scroll {
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

/* ================================
   PO LIST ITEMS
================================ */
.po-list-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
}

.po-list-item:hover {
    background-color: #f8f9fa;
    border-left-color: #0d6efd;
}

.po-list-item.active {
    background-color: #e7f1ff;
    border-left-color: #0d6efd;
    box-shadow: inset 0 0 0 1px #c8e0ff;
}

.po-list-item:last-child {
    border-bottom: none;
}

/* ================================
   FIRM FILTER & SEARCH
================================ */
#firmFilter {
    font-size: 0.875rem;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

#firmFilter:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-right: none;
    padding: 6px 10px;
}

#global_search {
    border-left: none;
    font-size: 0.875rem;
    padding: 6px 10px;
}

#global_search:focus {
    border-color: #dee2e6;
    box-shadow: none;
}

/* ================================
   TAB STYLING
================================ */
/* Generic nav-tabs — only for #poListTabs area, not #detailTabs */
#poListTabs.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}
#poListTabs.nav-tabs .nav-item {
    margin-bottom: -2px;
}
#poListTabs.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #212529;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
#poListTabs.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #0d6efd;
    background: #f8f9fa;
}
#poListTabs.nav-tabs .nav-link.active {
    color: #000;
    background-color: transparent;
    border-color: transparent transparent #0d6efd;
    font-weight: 600;
}

/* Active/Completed Tabs Specific Styling */
#poListTabs {
    margin-bottom: 0;
    border: none;
}

#poListTabs .nav-link {
    border-radius: 6px 6px 0 0;
    padding: 8px 12px;
    font-size: 0.85rem;
}

#poListTabs .nav-link.active {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-bottom: 2px solid #ffffff;
    color: #0d6efd;
}

/* ================================
   CARD STYLING
================================ */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin-bottom: 20px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    padding: 15px;
}

/* ================================
   SCROLLBAR STYLING
================================ */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* ================================
   PAGINATION STYLING
================================ */
#po_pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
}

#po_pagination button {
    font-size: 0.8rem;
    padding: 4px 12px;
}

#po_pagination .text-muted {
    font-size: 0.8rem;
}

/* ================================
   LOADER STYLING
================================ */
#po_loader {
    padding: 40px 0;
    text-align: center;
}

#po_loader .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* ================================
   RESPONSIVE ADJUSTMENTS
================================ */
@media (max-width: 992px) {
    .col-lg-3.col-md-4 {
        max-width: 100%;
        flex: 0 0 100%;
        margin-bottom: 20px;
    }

    .col-md-9 {
        max-width: 100%;
        flex: 0 0 100%;
    }

    #details_placeholder {
        min-height: 300px;
    }

    #details_placeholder img {
        width: 60px;
    }
}

/* ================================
   BUTTONS
================================ */
.btn-primary.w-100.mb-3 {
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-primary.w-100.mb-3:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* Upload Document Box */
.card.mt-3 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card.mt-3 .card-body {
    padding: 15px;
}

.card.mt-3 h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
}

/* Back Button Styling */
#backToList {
    transition: all 0.2s ease;
}

#backToList:hover {
    transform: translateX(-3px);
}

/* ================================
   COMPACT INLINE SEARCH STYLING
================================ */
#search_field_selector {
    font-size: 0.75rem;
    padding: 5px 8px;
    border-radius: 6px 0 0 6px;
    cursor: pointer;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-right: none !important;
    transition: all 0.2s ease;
}

#search_field_selector:hover {
    background: #ffffff;
}

#search_field_selector:focus {
    border-color: #86b7fe;
    box-shadow: none;
    outline: none;
    background: #ffffff;
}

#global_search {
    border-left: none !important;
    border-right: none !important;
    font-size: 0.875rem;
    padding: 6px 10px;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
}

#global_search:focus {
    border-color: #dee2e6;
    box-shadow: none;
    background-color: #ffffff;
}

#clear_search_btn {
    border-left: none !important;
    padding: 0 8px;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s ease;
}

#clear_search_btn:hover {
    background-color: #e9ecef;
    color: #dc3545;
}

/* Make the entire input group focused together */
.input-group:focus-within #search_field_selector,
.input-group:focus-within #global_search,
.input-group:focus-within #clear_search_btn {
    border-color: #86b7fe;
}

/* Uniform Input Group Styling */
.search-container .input-group {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.search-container .input-group-text,
.search-container .form-control,
.search-container .form-select,
.search-container .btn {
    border: none !important;
    box-shadow: none !important;
    background: transparent;
}

.search-container .input-group-text {
    background: #f8f9fa;
}

.search-container .form-control:focus,
.search-container .form-select:focus {
    outline: none;
    background: #fff;
}

.search-container .btn:hover {
    background: #0d6efd;
}

.search-container .btn:active {
    background: #dee2e6;
}

/* Dividers between sections */
.search-container .border-end-0+* {
    border-left: 1px solid #e9ecef !important;
}

/* ================================
   ENHANCED PAGINATION STYLING
================================ */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 8px 0;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 4px 8px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    font-weight: 500;
}

.pagination-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd;
    color: #0d6efd;
    background: #f8f9fa;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #e9ecef;
}

.pagination-btn.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-color: #0d6efd;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.pagination-btn.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.4);
    color: white;
}

.pagination-btn.btn-outline-primary {
    border-color: #0d6efd;
    color: #0d6efd;
    background: white;
}

.pagination-btn.btn-outline-primary:hover {
    background: #0d6efd;
    color: white;
}

.pagination-btn.btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
}

.pagination-btn.btn-secondary:disabled {
    background: #e9ecef;
    border-color: #dee2e6;
}

.pagination-container .text-muted {
    font-size: 0.75rem;
    white-space: nowrap;
    margin-left: 8px;
    color: #6c757d;
    font-weight: 500;
}

/* Ellipsis styling */
.pagination-container>span {
    padding: 0 4px;
    color: #adb5bd;
    font-weight: bold;
}

/* ================================
   LOADING STATES
================================ */
#po_loader {
    padding: 40px 0;
    text-align: center;
}

#po_loader .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2rem;
    color: #0d6efd;
}

/* Empty state */
#po_list_container:empty::after {
    content: 'No results found';
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #adb5bd;
    font-size: 0.9rem;
}

/* ================================
   RESPONSIVE DESIGN
================================ */
@media (max-width: 768px) {
    .pagination-btn {
        min-width: 28px;
        height: 28px;
        font-size: 0.75rem;
        padding: 2px 6px;
    }

    .pagination-container {
        gap: 2px;
    }

    .pagination-container .text-muted {
        display: none;
    }

    #search_field_selector {
        font-size: 0.75rem;
    }

    #search_hint {
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .pagination-btn:not(.btn-primary):not(:disabled):nth-child(n+6):nth-last-child(n+6) {
        display: none;
    }
}

/* ================================
   CARD FOOTER FIX
================================ */
.card-footer {
    background: white;
    border-top: 1px solid #f0f0f0;
    padding: 8px 12px;
}

/* ================================
   SMOOTH TRANSITIONS
================================ */
.pagination-btn,
#search_field_selector,
#global_search,
#clear_search_btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   FOCUS STATES
================================ */
.pagination-btn:focus,
#search_field_selector:focus,
#global_search:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* ================================
   HOVER EFFECTS
================================ */
.pagination-btn:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ================================
   BADGE STYLES FOR SEARCH RESULTS
================================ */
.search-result-badge {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 4px;
}

/* ================================
   NO RESULTS STATE
================================ */
.no-results-state {
    text-align: center;
    padding: 40px 20px;
}

.no-results-state i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 15px;
}

.no-results-state h6 {
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 8px;
}

.no-results-state p {
    color: #adb5bd;
    font-size: 0.85rem;
    margin: 0;
}

#po_detail_card {
    transition: filter 0.3s ease;
}

#po_detail_card.loading {
    filter: grayscale(0.5);
}
/* ================================================
   PO DETAIL HEADER  — redesigned
   ================================================ */

/* Replace grey card-header with clean white strip */
.po-detail-header {
    background: #ffffff;
    border-bottom: 2px solid #e3eaf3;
    padding: 12px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Firm logo container */
.po-firm-logo-wrap img {
    height: 38px;
    max-width: 130px;
    object-fit: contain;
}
.po-firm-logo-wrap .badge {
    font-size: 0.82rem;
    padding: 6px 10px;
    background: #1a56db !important;
    letter-spacing: 0.3px;
}

/* Single line header */
.po-header-single-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.4;
}

.po-header-single-line strong {
    color: #1a56db;
    font-weight: 600;
    margin-right: 4px;
}

/* PO number styling */
.po-header-num {
    color: #1a56db;
    font-weight: 700;
    font-size: 1rem;
}

/* Date styling */
.po-header-date {
    font-weight: 400;
    color: #6b7280;
}

/* Separators in single line */
.po-meta-sep {
    color: #d1d5db;
    font-size: 0.85rem;
    font-weight: 300;
    margin: 0 8px;
}

/* Rate text */
.po-meta-rate {
    color: #6b7280;
    font-size: 0.82rem;
}

/* Edit PO / Back buttons */
.po-btn-edit {
    background: #eff6ff;
    color: #1a56db;
    border: 1px solid #bfdbfe;
    font-size: 0.8rem;
    font-weight: 500;
}
.po-btn-edit:hover {
    background: #1a56db;
    color: #fff;
    border-color: #1a56db;
}
.po-btn-back {
    background: #f9fafb;
    color: #374151;
    border: 1px solid #d1d5db;
    font-size: 0.8rem;
    font-weight: 500;
}
.po-btn-back:hover {
    background: #374151;
    color: #fff;
    border-color: #374151;
}

/* ================================================
   DETAIL TABS  — pill button style
   ================================================ */
#detailTabs-wrap {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 16px 0;
}

#detailTabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    border: none;
}

#detailTabs .nav-item {
    margin: 0;
}

#detailTabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: #64748b;
    padding: 6px 13px;
    border-radius: 6px 6px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    text-decoration: none;
    margin-bottom: 0;
}

#detailTabs .nav-link i {
    font-size: 11.5px;
    opacity: 0.7;
}

#detailTabs .nav-link span {
    letter-spacing: 0.1px;
}

#detailTabs .nav-link:hover {
    color: #1e40af;
    background: #e0e9ff;
    border-color: #c7d7f8;
}

#detailTabs .nav-link.active {
    color: #1d4ed8;
    font-weight: 600;
    background: #ffffff;
    border-color: #cbd5e1 #cbd5e1 #ffffff;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.04);
}

#detailTabs .nav-link.active i {
    opacity: 1;
    color: #2563eb;
}