.suggestion-Item:hover{
    cursor: pointer;
    padding-left: 3px;;
 }
 
 
 /* lg and up: hide horizontal overflow */
 @media (min-width: 992px) {
    .overflow-lg-invisible {
      overflow: hidden !important;
    }
  }
 
#customerSuggestions {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.suggestion-item {
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none !important;
}

.drop-zone {
    border: 2px dashed #007bff;
    background-color: #f8f9fa;
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.drop-zone.highlight {
    background-color: #e2f0ff;
    border-color: #0056b3;
}

#editProofOfPayment[type="file"] {
    display: none;
}

/* Search Functionality Styles */
.search-section .form-control:focus,
.search-section .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Search button improvements */
#searchFilter {
    transition: all 0.2s ease;
}

#searchFilter:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading state for search */
.search-section.loading {
    opacity: 0.7;
    pointer-events: none;
}

.search-section.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive improvements */
@media (max-width: 1200px) {
    .search-section .row-cols-1 > .col {
        margin-bottom: 1rem;
    }
    
    .search-section .d-flex.align-items-end {
        align-items: stretch !important;
    }
}

/* DataTable search improvements */
.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Empty state styling */
.dataTables_empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Prevent unnecessary scrolling when content is minimal */
#main {
    min-height: auto !important;
    height: auto;
    display: flex;
    flex-direction: column;
}

#main .section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#main .section .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#main .section .card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#main .section .card .card-body .table-responsive {
    flex: 1;
    min-height: 0;
}

/* Horizontal scrolling for tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.scroll-x {
    min-width: 800px; /* Ensure minimum width for proper scrolling */
}

/* Ensure table headers stay visible during horizontal scroll */
.table-responsive thead th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

/* Ensure the page doesn't scroll unnecessarily on small content */
@media (max-height: 600px) {
    #main {
        padding: 10px 20px;
    }
    
    .pagetitle {
        margin-bottom: 5px;
    }
    
    .search-section {
        padding-bottom: 10px;
    }
}

/* Optimize layout for different screen sizes */
@media (min-height: 800px) {
    #main {
        min-height: calc(100vh - 60px);
    }
}

/* Ensure proper spacing without forcing full height */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html, body {
    height: auto;
    overflow-x: hidden;
}

/* Item Search Suggestions Styling */
.suggestions-container {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1050;
}

.suggestion-item {
    transition: background-color 0.15s ease-in-out;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f8f9fa !important;
}

.suggestion-item:last-child {
    border-bottom: none !important;
}

.suggestion-item .fw-bold {
    color: #212529;
    font-size: 0.875rem;
}

.suggestion-item small {
    font-size: 0.75rem;
}

/* Ensure the search input has proper border radius when suggestions are shown */
.item-desc-container input:focus {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Loading state for suggestions */
.suggestions-loading {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* No results state */
.suggestions-no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Mobile Sidebar Styles */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 60px);
        z-index: 999;
        transition: left 0.3s ease;
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    #sidebar.sidebar-show {
        left: 0;
    }

    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    #mobileMenuBtn {
        cursor: pointer;
        font-size: 1.5rem;
        color: #6c757d;
        transition: color 0.3s ease;
    }

    #mobileMenuBtn:hover {
        color: #0d6efd;
    }

    /* Ensure main content doesn't shift on mobile */
    #main {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Profile Dropdown Fixes */
.nav-profile {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.dropdown-toggle {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Hide dropdown arrow for profile */
.nav-profile.dropdown-toggle::after {
    display: none !important;
}

/* Ensure dropdown menu works properly */
.dropdown-menu {
    z-index: 1050 !important;
    display: none;
    position: absolute;
    background: white;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
}

.dropdown-menu.show {
    display: block !important;
}

/* Ensure dropdown items are clickable */
.dropdown-item {
    cursor: pointer;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:hover {
    color: #1e2125;
    background-color: #e9ecef;
}

/* Desktop sidebar behavior */
@media (min-width: 992px) {
    #mobileMenuBtn {
        display: none !important;
    }
}

/* Job Order Enhancements */
.client-suggestion-item,
.item-description-suggestion-item {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.client-suggestion-item:hover,
.item-description-suggestion-item:hover {
    background-color: #f8f9fa !important;
    border-left-color: #0d6efd;
    transform: translateX(2px);
}

.client-suggestion-item:last-child,
.item-description-suggestion-item:last-child {
    border-bottom: none !important;
}

/* Order Items Styling */
.order-item-row {
    transition: all 0.3s ease;
}

.order-item-row:hover {
    background-color: #f8f9fa;
}

.order-item-row td {
    vertical-align: middle;
    padding: 0.75rem;
}

/* Enhanced form styling */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Loading states */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Suggestions container */
#clientSuggestions,
#editClientSuggestions,
#itemDescriptionSuggestions,
#editItemDescriptionSuggestions {
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Total amount display - simplified */
#totalAmountDisplay,
#editTotalAmountDisplay {
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Item count display - simplified */
#itemCountDisplay,
#editItemCountDisplay {
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Animation for new items */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.order-item-row {
    animation: slideInFromRight 0.3s ease-out;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .order-item-row td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Enhanced table styling */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Badge improvements */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Form validation styling */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Enhanced modal styling */
.modal-header {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
}

/* Success/Error message styling */
.toast-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.toast-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Job Order Expenses Styles */
#itemSuggestions {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    background: white;
    z-index: 1050;
}

#itemSuggestions .list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0;
    cursor: pointer;
}

#itemSuggestions .list-group-item:first-child {
    border-top: none;
}

#itemSuggestions .list-group-item:last-child {
    border-bottom: none;
}

#itemSuggestions .list-group-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item {
    transition: background-color 0.15s ease-in-out;
}

/* Financial Summary Cards */
.card.bg-light {
    border: 1px solid #dee2e6;
}

.card.bg-light .card-title {
    color: #495057;
    font-weight: 600;
}

/* Profit/Loss styling */
.text-success {
    color: #198754 !important;
}

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

/* Expenses table styling */
#expensesTable .btn-group .btn {
    margin-right: 2px;
}

#expensesTable .btn-group .btn:last-child {
    margin-right: 0;
}