
/* ======================== SIDEBAR STYLES ======================== */
/* Dashboard specific styles */

.dashboard-sidebar {
    background-color: var(--primary-color);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto; /* Enable scrolling within sidebar if needed */
    padding-bottom: 20px;
}

.dashboard-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.dashboard-card .card-body {
    padding: 1.5rem;
}


/* Make sidebar content flex column */
.sidebar-sticky {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-brand {
    color: white !important;
    font-weight: 600;
    letter-spacing: 0.1rem;
}

.nav-item {
    margin: 0.5rem 0;
}

.nav-link {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    color: #dee2e6 !important;
}

.nav-link.active-sidebar {
    border-left-color: var(--accent-color);
    border-radius: 0.375rem;
    background-color: #eef2ff !important;
    color: #4361ee !important;
    font-weight: 500;
    border-left: 3px solid #4361ee !important;
}

.nav-link:hover {
    background-color: var(--secondary-color);
    border-radius: 0.375rem;
}

.nav-link:hover:not(.active-sidebar) {
    background-color: rgba(255, 255, 255, 0.05);
}


.nav.flex-column {
    flex-grow: 1; /* Takes available space */
}


.no-wrap-header {
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}


/* Style for logout container */
.mt-auto {
    margin-top: auto !important; /* Pushes to bottom */
    /* padding-top: 1rem; */
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* ======================== MAIN CONTENT ======================== */

.main-content {
    background-color: #f8f9fa;
    min-height: 100vh;
    background: #f8f9fa;
}

.logout-section {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--secondary-color);
}

#content-area {
    padding-top: 1rem;
}


/* ======================== TABLE STYLES ======================== */

.table {
    table-layout: fixed;
}

.table td.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Show full description on hover */
.table td.text-truncate:hover {
    white-space: normal;
    overflow: visible;
    z-index: 2;
    position: relative;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.table th {
    font-weight: 600;
    color: var(--dark);
    background-color: #f8f9fa;
    vertical-align: middle;
    padding: 1rem;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


.text-nowrap {
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}


/* ======================== MODAL SPECIFIC STYLES ======================== */

#projectDetailModal .modal-content {
    border-radius: 0.8rem;
    max-height: 90vh;
}

#projectDetailModal .modal-header {
    border-bottom: 2px solid #dee2e6;
    padding: 1.2rem 1.5rem;
}

#projectDetailModal .modal-body {
    padding: 1.5rem;
    line-height: 1.7;
    max-height: 80vh;
    overflow-y: auto;
}

#projectDetailModal .card {
    border: none;
    border-radius: 0.5rem;
}

#projectDetailModal .modal-xl {
    max-width: 90%;
}

#projectDetailModal .modal-dialog {
    max-width: 98%;
    width: 98%;
}

/* ======================== BOQ TABLE STRUCTURE ======================== */

#projectDetailModal table {
    border: 2px solid #dee2e6;
    border-collapse: separate;
    border-radius: 0.5rem;
    border-spacing: 0;
    overflow: hidden;
    table-layout: fixed !important;
    width: 100% !important;
    word-wrap: break-word;
}

#projectDetailModal td,
#projectDetailModal th {
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#projectDetailModal th {
    font-size: 0.85rem;
    text-align: center !important;
}


#projectDetailModal td {
    font-size: 0.88rem;
}

#projectDetailModal thead th {
    border-bottom: 2px solid #dee2e6 !important;
    background: #f8f9fa !important;
    white-space: normal !important;
    text-overflow: clip !important;
    overflow: visible !important;
    line-height: 1.2;
    padding: 12px 8px !important;
    vertical-align: top;
}

#projectDetailModal tbody tr:last-child td {
    border-bottom: none;
}

#projectDetailModal .numeric-cell {
    white-space: nowrap !important;
    text-align: center !important;
    padding: 8px 12px !important;
}


/* ======================== COLUMN ALIGNMENTS ======================== */
/* Tender Columns */
/*#projectDetailModal .tender-item { 
    width: 18% !important;
    text-align: left !important;
}*/

#projectDetailModal .tender-qty,
#projectDetailModal .tender-rate,
#projectDetailModal .tender-total,
#projectDetailModal .project-price,
#projectDetailModal .project-qty,
#projectDetailModal .project-total,
#projectDetailModal .project-balance {
    width: auto !important; /* Let colgroup handle widths */
    
}

#projectDetailModal .tender-uom,
#projectDetailModal .project-uom {
    width: auto !important;
    text-align: center !important;
}

/* Project Columns */
#projectDetailModal .project-item { 
    width: 20% !important;
    text-align: left !important;
}


/* Add to dashboard.css */
#projectDetailModal .project-ordered {
    width: 8% !important;
    text-align: center !important;
}

.ordered-btn {
    padding: 0.25rem 0.25rem;
    font-size: 0.5rem;
    
}


/* ======================== Request List Styling ======================== */
/* Add to your main.css or dashboard.css */
/* Request list specific styles */
.request-list .border-light {
    border-bottom: 1px solid #e9ecef !important;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.request-list .bg-light {
    background-color: #f8f9fa !important;
    border-radius: 8px;
    padding: 1rem !important;
}

.request-list .btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    min-width: 90px;
}

.request-list .btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.request-list .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

/* Add hover effects */
.request-list .btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
}

.request-list .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}

/* Status badges */
.request-list .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529;
}

.request-list .badge.bg-success {
    background-color: #28a745 !important;
}

.request-list .badge.bg-danger {
    background-color: #dc3545 !important;
}


/* Add to main.css or dashboard.css */
.action-details {
    background-color: #f8f9fa;
    border-left: 3px solid #4361ee;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.approved-detail {
    border-left-color: #28a745;
}

.declined-detail {
    border-left-color: #dc3545;
}


/* Ensure icon is centered */
.centered-icon i {
    margin: 0 !important; /* Remove any margins */
}

/* ======================== Ordery Modal Styling ======================== */

#orderedModal .modal-dialog::-webkit-scrollbar{
    display: none; /* Chrome/Safari/Opera */
}

#orderedModal .modal-dialog {
    max-width: 1200px; /* Adjust width as needed */
    height: 90vh;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

#orderedModal .modal-content {
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

.ordery-modal-bg {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid rgba(24, 25, 26, 0.2);
    border-radius: 0.8rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#orderedModal .modal-header {
    border-bottom: 1px solid rgba(0, 123, 255, 0.1);
    border-radius: 0.8rem 0.8rem 0 0;
    padding: 0.75rem 1.5rem !important;  /* Slightly reduced padding */
}

#orderedModal .modal-title {
    font-size: 1.1rem !important;  /* Slightly smaller title */
}

#orderedModal .modal-body {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    margin: 0.5rem;
    border-radius: 0.5rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    
}

#orderedModal .form-control {
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    height: 40px;
}

#orderedModal .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#orderedModal .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

#orderedModal .input-group-text {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

#orderedModal #totalOrdered {
    background-color: #f8f9fa;
    font-weight: 500;
}



#orderyForm .d-flex .btn {
    margin-right: 15px;
    margin-top: -20px;
}

/* Add to dashboard.css */
#orderyNotes {
    min-height: 40px;  
    height: 40px;
    width: 80%;
    resize: vertical;
}

.text-muted.small {
    font-size: 0.8rem;
    color: #6c757d!important;
}

/* Add to dashboard.css */
.ordery-input-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.ordery-input-group textarea {
    min-height: 40px;
    resize: vertical;
}

.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}


#orderedModal .modal-footer {
    padding: 0.5rem 1rem !important;  /* Reduced from default 1rem */
    margin-top: 0 !important;         /* Remove default margin */
    border-top: 1px solid #dee2e6;    /* Lighter border */
}

#orderedModal .modal-footer .btn {
    padding: 0.25rem 0.75rem !important;  /* Smaller button padding */
    font-size: 0.875rem !important;       /* Smaller text */
}


/* Left Column (Form) */
#orderedModal .col-md-6.pe-3 {
    overflow-y: visible !important;
    padding-right: 1rem !important;
    height: auto !important;
}

/* Right Column (Invoice List) */
#orderedModal .col-md-6 {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#orderedModal .card.h-100 {
    height: 100% !important;
    display: flex;
    flex-direction: column;
}

#orderedModal #invoicePreview {
    flex: 1;
    overflow-y: auto !important;
}

/* ======================== Invoice Modal Styling ======================== */

/* Invoice Preview Card */
#invoicePreview {
    min-height: 300px;
    flex-direction: column;
    justify-content: center;
}



#downloadInvoice {
    transition: all 0.3s ease;
}


/* Add this to your invoice card styling */
.text-xs {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.1rem;
}


/* Add to dashboard.css */
.text-remarks {
    font-size: 0.8rem;
    color: #6c757d;
    max-width: 200px;
    white-space: pre-wrap;
    word-break: break-word;
    white-space: normal !important;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    min-width: 0; /* Fixes flexbox overflow issues */
    hyphens: auto; /* Enable hyphenation for long words */
    line-height: 1.4; /* Better readability for wrapped text */
}

/* Ensure parent containers allow wrapping */
.card-bg-light {
    min-width: 0; /* Fixes flexbox text overflow */
}

/* dashboard.css */
.card.border-success {
    border-left: 3px solid #28a745 !important;
}


/* dashboard.css */
.paid-badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    margin-top: 0.25rem;
}



/* ======================== Disabling dropdown Styling ======================== */

/* Style for disabled dropdowns */
.disabled-dropdown {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Tooltip styling */
[tooltip]:hover::after {
    content: attr(tooltip);
    position: absolute;
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    margin-top: -30px;
    margin-left: 10px;
}

/* Locked fields styling */
.locked-field {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Lock icon styling */
.lock-icon {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 5;
}

/* Adjust input group to accommodate lock icon */
.input-group {
    position: relative;
}

/* Disable pointer events on locked fields */
.locked-field {
    pointer-events: none;
}


/* Add red border for invalid date fields */
.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}


/* ======== NEW ADDITIONS (MODERN UI) ======== */
/* Dashboard Specific Enhancements */
.main-content {
    padding: 1.5rem;
    margin-left: 16.666667%; /* Match sidebar width */
    width: 83.333333%; /* Match content width */
}

/* Table enhancements */
.table-hover tbody tr:hover {
    background-color: #f1f5ff;
}

/* Modal enhancements */
.modal-content {
    border-radius: 12px;
    overflow: hidden;
}

.modal-header {
    background-color: var(--primary);
    color: white;
    padding: 1.25rem;
}

.modal-header .btn-close {
    margin-left: 0.5rem; /* Added space between buttons and close */
    filter: brightness(0.6) !important; /* Darker close button */
}

.modal-title {
    font-weight: 600;
}


.modal-header .btn {
    margin-right: 8px; 
}

.modal-body {
    padding: 1.5rem;
}

/* Form group spacing */
.form-group {
    margin-bottom: 1.5rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
    border-radius: 8px;
    font-size: 0.8rem;
}

/* Project timeline */
.progress {
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    border-radius: 4px;
}

/* Material items */
.material-row {
    background-color: #f9fbfd;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Action buttons */
.action-buttons .btn {
    margin-right: 0.5rem;
}


/* Toast notifications */
.toast {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}


/* Ensure proper flexbox behavior */
.modal-body {
    display: flex;
    flex-direction: column;
}



/* ======================== Calendar Style ======================== */

/* Hide native date picker icon */
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
}

/* Hide native date picker completely */
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
}

/* Add this to your CSS */
.flatpickr-input {
    cursor: pointer;
    background-color: white;
}

.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
    pointer-events: none;
    color: #6c757d;
}


/* ======================== User Profile Style ======================== */

/* Add this new style for user profile */
.user-profile {
    background-color: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}


.user-profile:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}


.badge.bg-primary-opacity {
    background-color: rgba(67, 97, 238, 0.1) !important;
    color: var(--primary) !important;
}



/* ======================== Selection assigned user Style ======================== */

#id_assigned_users {
    height: 150px !important;
    min-height: 150px;
    width: 100%;
}

#id_assigned_users option {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}


/* ======================== Notification message Style ======================== */



/* Add this to fix close button alignment */
.alert .btn-close {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

/* Adjust alert padding to make room for centered close button */
.alert {
    padding-right: 3.5rem; /* Increased from default 3rem */
}

/* Ensure proper alignment for multi-line alerts */
.alert-dismissible {
    display: flex;
    align-items: center;
}

/* Add transition for smooth fade-out */

.alert {
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: opacity 0.5s ease;
}






/* ======================== Mobile UI Style ======================== */

/* Add this to handle mobile views */
@media (max-width: 768px) {
    .dashboard-sidebar {
        min-height: 0;
        height: auto;
        position: relative;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 100%;
        box-shadow: none;
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
    }

    #content-area {
        padding: 15px;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}


/* Fix for flatpickr mobile */
.flatpickr-calendar {
    z-index: 99999 !important; /* Higher than mobile menu */
    touch-action: manipulation; /* Better touch handling */
}

/* Mobile Sidebar */
@media (max-width: 767.98px) {
    .dashboard-sidebar.mobile-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        width: 280px;
        transition: left 0.3s ease;
        overflow-y: auto;
        min-height: 100vh;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .dashboard-sidebar.mobile-sidebar.active {
        left: 0;
    }
    
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    
    .mobile-sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
        padding-top: 0.5rem;
    }
    
    /* Position the mobile menu button */
    #mobileMenuToggle {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1030;
    }


    /* Dashboard activities */

    .activity-list .d-flex.align-items-start {
        flex-direction: row !important; /* Keep horizontal layout */
        align-items: center;
        padding: 0.5rem 0;
    }
    
    .activity-list .d-flex.justify-content-between {
        width: 100%;
        flex-direction: column;
        gap: 0.25rem;
    }


    .activity-list .d-flex.justify-content-between.flex-wrap {
        flex-direction: row !important;
        align-items: center;
        width: 100%;
    }


    .activity-list .fw-medium.small {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60%;
    }


    .activity-list .flex-shrink-0.text-muted.small {
        margin-left: auto !important; /* Push to right */
        padding-left: 0.5rem;
    }


    .activity-list .text-nowrap.ms-2 {
        margin-left: 0 !important;
        margin-top: 0.25rem;
    }


    .activity-list .d-flex {
        flex-direction: column;
    }
    
    .activity-list .flex-shrink-0 {
        margin-bottom: 0 !important;
        margin-right: 0.5rem;
    }
    
    
    .activity-list .text-nowrap {
        margin-top: 5px;
        margin-left: 0;
    }

    .activity-list .bg-light.rounded {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem !important;
    }


    .activity-list .bg-light.rounded .d-flex {
        flex-direction: row !important;
        align-items: center;
        margin-bottom: 0 !important;
        margin-bottom: 0 !important; /* Remove all bottom margin */
        padding-bottom: 0 !important; /* Remove any padding */
        line-height: 1.3; /* Tighter line height */
    }


    
    .activity-list .bg-light.rounded .d-flex > * {
        display: inline-flex;
        align-items: center;
    }


    .activity-list .bg-light.rounded > div {
        margin-bottom: 0 !important;
    }


    .activity-list .bg-light.rounded .d-flex .me-1 {
        margin-right: 0.25rem !important;
        margin-bottom: 0;
    }


    .activity-list .bg-light.rounded .d-flex span {
        display: inline;
        white-space: nowrap;
        overflow: visible;
    }
    

    .activity-list .text-muted.small {
        font-size: 0.75rem;
    }


    #activityDateFilter {
        padding: 0.75rem 1rem !important;
        font-size: 1rem;
    }

    
    
    .flatpickr-calendar {
        max-width: 90vw !important;
        width: 90vw !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 99999 !important;
        
    }


    
    .flatpickr-calendar .flatpickr-day {
        height: 40px;
        line-height: 40px;
    }


    /* Request list optimizations */
    .request-list .d-flex.align-items-start {
        flex-direction: row !important; /* Keep horizontal layout */
        align-items: center;
        padding: 0.5rem 0;
    }
    
    .request-list .flex-shrink-0 {
        margin-bottom: 0 !important;
        margin-right: 0.5rem;
        width: 36px !important; /* Slightly smaller for mobile */
        height: 36px !important;
    }
    
    .request-list .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .request-list .text-nowrap.ms-2 {
        margin-left: 0 !important;
        margin-top: 0.25rem;
    }
    
    .request-list .bg-light.rounded {
        padding: 0.75rem !important;
        font-size: 0.85rem;
    }
    
    .request-list .action-details {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .request-list .mt-3.d-flex.justify-content-end {
        margin-top: 0.5rem !important;
    }
    
    .request-list .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }




    /* Item list mobile optimizations */

    .item-content-header .d-flex {
        flex-direction: column !important;
    }


    .item-content-header .btn,
    .item-content-header .btn-outline-secondary {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }


    .item-content-header .ms-2 {
        margin-left: 0 !important;
    }



    .item-list .table-responsive {
        overflow-x: hidden;
    }
    
    .item-list-table {
        display: block;
        width: 100%;
    }
    
    .item-list-table thead {
        display: none;
    }
    
    .item-list-table tbody {
        display: block;
    }

    .item-list-table tr {
        display: block;
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .item-list-table td {
        display: block;
        width: 100%;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding-left: 40%;
    }
    
    .item-list-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }


    .item-list-table td:before {
        content: attr(data-label);
        font-weight: 600;
        position: absolute;
        left: 0;
        top: 0.75rem;
        width: 35%;
        padding-right: 1rem;
        color: var(--dark);
        word-break: break-word;
    }
    
    
    
    
    
    .item-list-table .text-truncate {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        text-align: right; /* Ensure content left aligned */
    }
    
    /* Actions cell */
    .item-list-table td[data-label="Actions"] {
        padding-left: 0;
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid #f0f0f0;
        text-align: right;
    }
    
    .item-list-table td[data-label="Actions"]:before {
        position: static;
        width: 100%;
        text-align: left;
        margin-bottom: 0.5rem;
    }
    
    
    
    /* Filter form adjustments */
    .item-list .card-body .row {
        flex-direction: column;
        gap: 0.75rem;
    }


    .item-list .col-md-4,
    .item-list .col-md-2 {
        width: 100%;
        max-width: 100%;
    }
    
    .item-list .btn {
        width: 100%;
    }



    /* Tender/Contract list mobile optimizations */

    .tender-content-header .d-flex {
        flex-direction: column !important;
    }


    .tender-content-header .btn,
    .tender-content-header .btn-outline-secondary {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }


    .tender-content-header .ms-2 {
        margin-left: 0 !important;
    }


    .tender-list-table {
        display: block;
        width: 100%;
    }
    
    .tender-list-table thead {
        display: none;
    }
    
    .tender-list-table tbody {
        display: block;
    }

    .tender-list-table tr {
        display: block;
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .tender-list-table td {
        display: block;
        width: 100%;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding-left: 40%;
    }
    
    .tender-list-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .tender-list-table td:before {
        content: attr(data-label);
        font-weight: 600;
        position: absolute;
        left: 0;
        top: 0.75rem;
        width: 35%;
        padding-right: 1rem;
        color: var(--dark);
        word-break: break-word;
    }
    
    /* Numeric cells alignment */
    .tender-list-table .numeric-cell {
        text-align: right !important;
    }
    
    /* Actions cell */
    .tender-list-table td[data-label="Actions"] {
        padding-left: 0;
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid #f0f0f0;
        text-align: right;
    }
    
    .tender-list-table td[data-label="Actions"]:before {
        position: static;
        width: 100%;
        text-align: left;
        margin-bottom: 0.5rem;
    }
    
    /* Button spacing */
    .tender-list-table .btn {
        margin: 0 0.25rem;
    }



    /* Project list mobile optimizations */
    /* Project Detail Modal Mobile Optimizations */
    /* Project Detail Modal - Bold Labels */

    #projectDetailModal dl dt {
        font-weight: 700 !important;
        color: #212529 !important; /* Darker text color */
        font-size: 0.95rem !important;
        /* text-transform: uppercase; */
        letter-spacing: 0.2px;
        margin-bottom: 0.25rem;
    }

    /* Optional: Improve spacing */
    #projectDetailModal dl.row {
        background-color: rgba(248, 249, 250, 0.5);
        padding: 0.75rem;
        border-radius: 6px;
        margin-bottom: 0.5rem;
    }


    #projectDetailModal dl dd {
        font-weight: 400;
        color: #343a40;
        font-size: 0.65rem;
        /* padding-left: 1rem; */
    }


    #projectDetailModal dl.row:last-child {
        margin-bottom: 0;
    }


    #projectDetailModal .modal-dialog {
        max-width: 100%;
        margin: 0.5rem;
        height: 100%;
    }
    
    #projectDetailModal .modal-content {
        height: 95vh;
        overflow-y: auto;
    }
    
    #projectDetailModal .modal-body {
        padding: 1rem;
    }
    
    #projectDetailModal .row {
        flex-direction: column;
    }
    
    #projectDetailModal .col-md-4,
    #projectDetailModal .col-md-8 {
        width: 100%;
        max-width: 100%;
    }
    
    #projectDetailModal .card {
        margin-bottom: 1rem;
    }
    
    /* Header adjustments */
    #projectDetailModal .modal-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }
    
    #projectDetailModal .modal-header > div {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.5rem;
    }
    
    #projectDetailModal .modal-header .btn {
        margin: 0.25rem;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* BOQ table adjustments */
    #projectDetailModal .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #projectDetailModal table {
        min-width: 1000px;
        font-size: 0.8rem;
    }
    
    #projectDetailModal .table th,
    #projectDetailModal .table td {
        padding: 0.5rem;
    }
    
    #projectDetailModal .progress {
        height: 18px;
    }
    
    #projectDetailModal .progress-bar {
        font-size: 0.7rem;
        line-height: 18px;
    }
    
    /* Form elements */
    #projectDetailModal .form-control,
    #projectDetailModal .form-select {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    /* Action buttons in tables */
    #projectDetailModal .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Ordered modal adjustments */
    #orderedModal .modal-dialog,
    #deliveryModal .modal-dialog {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    #orderedModal .row,
    #deliveryModal .row {
        flex-direction: column;
        height: calc(100% - 50px); /* Account for header */
        margin: 0;
    }
    
    #orderedModal .col-md-6,
    #deliveryModal .col-md-6 {
        width: 100%;
        height: auto !important;
        padding: 0;
        margin: 0;
    }
    
    #orderedModal .col-md-6:first-child,
    #deliveryModal .col-md-6:first-child {
        height: 45% !important; /* Reduced height */
        padding-bottom: 0;
        border-bottom: 1px solid #dee2e6;
    }

    #orderedModal .col-md-6:last-child,
    #deliveryModal .col-md-6:last-child {
        height: 55% !important; /* More space for preview */
    }


    #orderyForm,
    #deliveryForm {
        height: 100%;
        display: flex;
        flex-direction: column;
    }




    #orderedModal .card,
    #deliveryModal .card {
        height: 100%;
        margin: 0;
    }


    #orderedModal .modal-header,
    #deliveryModal .modal-header {
        padding: 0.75rem;
    }
    

    #orderyForm .flex-grow-1,
    #deliveryForm .flex-grow-1 {
        overflow-y: auto;
        padding: 0 0.5rem;
        margin-bottom: 0.5rem;
        flex-grow: 1;
    }


    /* Button positioning */
    #orderyForm .d-flex,
    #deliveryForm .d-flex {
        margin-top: auto;
        padding: 0.5rem;
        background: white;
    }
    
    /* Input group fixes */
    .ordery-input-group {
        margin-bottom: 0.5rem;
    }
    
    
    /* Invoice preview */
    #invoicePreview,
    #deliveryPreview {
        height: calc(100% - 46px) !important;
        overflow-y: auto;
        padding: 0.5rem;
    }

    #orderyNotes,
    #deliveryNotes {
        height: 80px; /* Fixed height */
    }
    
    
    #orderyForm .btn,
    #deliveryForm .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    #orderedModal .modal-footer,
    #deliveryModal .modal-footer {
        padding: 0.75rem;
    }


    
    /* BOQ Mobile Card View */
    #boqAccordion .table {
        display: none; /* Hide table on mobile */
    }
    
    .boq-mobile-view {
        display: block !important;
    }
    
    .boq-mobile-card {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        margin-bottom: 1rem;
        overflow: hidden;
    }
    
    .boq-mobile-header {
        padding: 1rem;
        background: #f8f9fa;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #eee;
    }
    
    .boq-mobile-title {
        font-weight: 600;
        flex-grow: 1;
    }
    
    .boq-mobile-toggle {
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #4361ee;
    }
    
    .boq-mobile-content {
        padding: 1rem;
        display: none;
    }
    
    .boq-mobile-section {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }
    
    .boq-mobile-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .boq-mobile-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }
    
    .boq-mobile-label {
        font-weight: 500;
        color: #6c757d;
        flex: 1;
    }
    
    .boq-mobile-value {
        font-weight: 500;
        flex: 1;
        text-align: right;
    }
    
    .boq-mobile-actions {
        display: flex;
        justify-content: center;
        padding-top: 1rem;
        border-top: 1px solid #eee;
        margin-top: 1rem;
    }



    
    /* Pagination adjustments */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .page-item {
        margin: 0;
    }



    /* Common card optimizations */
    .card-body.p-0 .d-flex {
        padding: 0.75rem;
    }



    /* Target the specific table in project list */
    .card-body table.table-striped {
        display: block;
        width: 100%;
    }
    
    .card-body table.table-striped thead {
        display: none;
    }
    
    .card-body table.table-striped tbody {
        display: block;
        width: 100%;
    }
    
    .card-body table.table-striped tr {
        display: flex;
        flex-direction: column;
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .card-body table.table-striped td {
        /* display: flex; */
        flex-direction: column;
        width: 100% !important;
        padding: 0.75rem 0 !important;
        border: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    
    


    .card-body table.table-striped td:last-child {
        border-bottom: none !important;
        padding-top: 1rem !important;
        align-items: center;
    }
    
    /* Progress bar fixes */
    .card-body table.table-striped .progress {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Add custom labels */
    .card-body table.table-striped td:nth-child(1):before {
        content: "Project Name";
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .card-body table.table-striped td:nth-child(2):before {
        content: "Project Code";
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .card-body table.table-striped td:nth-child(3):before {
        content: "Location";
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .card-body table.table-striped td:nth-child(4):before {
        content: "Created At";
        font-weight: 600;
        margin-bottom: 0.25rem;
    }
    
    .card-body table.table-striped td:nth-child(5):before {
        content: "Timeframe";
        font-weight: 600;
        margin-bottom: 0.25rem;
        display: block;
        width: 100%;
        padding-bottom: 0;
        border-bottom: none !important;
    }
    
    .card-body table.table-striped td:nth-child(6):before {
        content: "Work Progress";
        font-weight: 600;
        margin-bottom: 0.25rem;
        display: block;
        width: 100%;
        padding-bottom: 0;
        border-bottom: none !important;
    }
    
    .card-body table.table-striped td:nth-child(7):before {
        content: none;
    }
    
    /* Progress bar container adjustment */
    .card-body table.table-striped .d-flex.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .card-body table.table-striped .flex-grow-1.me-2 {
        width: 100%;
        margin-left: 0.2rem !important;
    }



    
    .card-header .d-flex {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start !important;
    }
    
    .card-header .badge {
        margin-top: 0.25rem;
    }



    /* Dashbaord Card list adjustments */
    
    .btn.rounded-pill {
        padding: 0.5rem 1rem;
    }
    

    #mobileMenuContainer {
        top: 70px; /* Position below header */
        left: 15px;
    }

    

    /* Header adjustments */

    .content-header h1 {
        font-size: 1.25rem;
    }
    
    .content-header p {
        font-size: 0.85rem;
    }

    .card-header h5 {
        font-size: 1rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        margin-top: 50px; /* Space for menu button */
        padding-top: 50px;
    }
    

    .content-header > div:first-child {
        margin-bottom: 15px;
    }
    
    .content-header > div:last-child {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .content-header .position-relative {
        width: 100%;
    }
    
    .content-header input {
        width: 100% !important;
    }
    
    .content-header .btn {
        width: 100%;
    }

    
    /* Mobile menu button positioning */
    #mobileMenuContainer {
        top: 15px;
        left: 15px;
        z-index: 1030;
    }
    
    /* Ensure content doesn't overlap */
    #content-area {
        padding-top: 10px !important;
    }
}


/* Fix for iOS input zoom */
@media (max-width: 767px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}



/* Adjust header spacing on mobile */
@media (max-width: 576px) {
    .h1, h1 { font-size: 1.5rem; }
    .h2, h2 { font-size: 1.3rem; }
    

    #mobileMenuContainer {
        top: 60px;
    }


    .content-header {
        flex-direction: column;
        align-items: flex-start;
        margin-top: 30px;
    }
    
    .btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
    }


    .activity-list .d-flex.justify-content-between {
        flex-direction: column;
    }
    
    .activity-list .text-nowrap {
        margin-top: 0.25rem;
        margin-left: 0;
    }

}


/* Add this to dashboard.css */
#mobileMenuContainer {
    z-index: 1030; /* Ensure it's above other content */
}

.dashboard-sidebar.mobile-sidebar {
    z-index: 1050; /* Higher than menu button */
    transition: left 0.3s ease;
}

.mobile-sidebar-overlay {
    z-index: 1040; /* Between button and sidebar */
}

