body {
    font-family: Arial, sans-serif;
    background-color: #1a1a2e;
    color: white;
    text-align: center;
    margin: 0;
    padding: 0;
}

header {
    background: #16213e;
    padding: 20px;
    text-align: center;
    font-size: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.header-content {
    display: flex;
    align-items: center;
}

.company-logo {
    height: 60px;
    width: auto;
    margin-left: 20px;
}

#searchBar {
    width: 50%;
    padding: 10px;
    margin-top: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: none;
}

#addJobBtn {
    padding: 10px 20px;
    font-size: 16px;
    margin-top: 10px;
    background-color: #30475e;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.2s;
}

#addJobBtn:hover {
    background-color: #1b2b3a;
}

main {
    padding: 20px;
}













































table {
    width: 90%;
    margin: auto;
    border-collapse: collapse;
    background: #0f3460;
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: #23395d;
}

thead th {
    padding: 15px;
    color: white;
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid #333;
}

tbody tr:nth-child(even) {
    background: #1b1b3a;
}



.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0d1222;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(253, 252, 252, 0.3);
    width: 60%;
    max-width: 600px;
    text-align: left;
    z-index: 1000;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px;
    padding: 20px;
}

.full-width {
    grid-column: span 2;
}

.modal label {
    display: flex;
    flex-direction: column;
    margin: 5px 0;
    width: 100%;
}

.modal input, .modal textarea, .modal select {
    width: 100%;
    padding: 8px;
    margin-top: 3px;
    border-radius: 5px;
    border: none;
    font-size: 14px;
    background: #fefeff;
    color: rgb(0, 0, 0);
}

.modal button {
    grid-column: span 2;
    margin-top: 15px;
    padding: 10px;
    width: 100%;
    background-color: #1f70c2;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.modal button:hover {
    background-color: #0481f7;
}

.close {
    float: right;
    font-size: 24px;
    cursor: pointer;
}

/* Status Colors - Muted for Dark Background 
.status-not-started { background-color: #a68a00; color: white; } 
.status-in-process { background-color: #0077b6; color: white; }
.status-done { background-color: #2d6a4f; color: white; }
.status-late { background-color: #b91c1c; color: white; } 
.status-on-hold { background-color: #5e3b76; color: white; } 
.status-waiting-materials { background-color: #cc7700; color: white; } 
.status-waiting-delivery { background-color: #b45f06; color: white; } */

/* Job Progress Bar */
.progress-container {
    width: 100%;
    background-color: #333;
    border-radius: 5px;
    margin-top: 5px;
    height: 15px;
}

.progress-bar {
    height: 100%;
    text-align: center;
    line-height: 15px;
    color: white;
    font-size: 12px;
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

/* Expandable Hours Section */
.hours-log {
    display: none;
    background: #1b1b3a;
    color: white;
    padding: 10px;
    margin-top: 5px;
    border-radius: 5px;
}

.hours-log table {
    width: 100%;
    border-collapse: collapse;
}

.hours-log th, .hours-log td {
    padding: 8px;
    border: 1px solid #555;
}

.hours-log tr:nth-child(even) {
    background-color: #232342;
}

/* Updated Add Hours Button */
/* Button Container - Keep Buttons in a Row */
.button-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* Adjust spacing between buttons */
    flex-wrap: wrap; /* Prevents overflow on small screens */
}
.button-group {
    display: flex; /* ✅ Ensures visibility when needed */
    transition: opacity 0.3s ease-in-out; /* ✅ Smooth hiding effect */
}

/* Modernized Buttons */
.add-hours-btn, .toggle-hours-btn, .delete-btn {
    padding: 6px 10px;
    font-size: 12px; /* Smaller text for compact fit */
    min-width: 120px; /* Ensures buttons are not too wide */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: bold;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Keep Buttons in One Line */
button span {
    font-size: 14px; /* Icon size */
}

/* Improve Hover Effects */
.add-hours-btn:hover, .toggle-hours-btn:hover, .delete-btn:hover {
    transform: translateY(-1px);
}











/* Editable Table Cells */
.edit-input {
    width: 100%;
    padding: 4px;
    font-size: 14px;
    background: #0e0e22;
    color: white;
    border: 1px solid #5bc0be;
    border-radius: 4px;
}
/* 📱 Mobile Optimized Table */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid #30475e;
        border-radius: 8px;
        background: #1b1b3a;
        padding: 10px;
    }

    td {
        text-align: left;
        padding: 10px;
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #333;
    }

    td:last-child {
        border-bottom: none;
    }

    td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #5bc0be;
    }
}















/* 🔹 Larger Dashboard Modal on PC */
#dashboardModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #16213e;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0px 0px 15px rgba(255, 255, 255, 0.2);
    color: white;
    text-align: center;
    z-index: 1000;
    max-height: 90vh;
    overflow-y: auto;
}

/* 📱 Responsive Size for Mobile */
@media (max-width: 768px) {
    #dashboardModal {
        width: 90%;
        max-width: 500px;
        padding: 20px;
    }
}
#dashboardModal {
    width: 75%;
    max-width: 850px;
}

/* 📊 Make Graphs Smaller */
#jobsByStatusChart {
    max-width: 300px;
    height: 350px !important;
    margin: -30px auto;
  
}
#jobsByTypeChart {
    max-width: 350px;
    height: 200px !important;
    margin: -30px auto;
  
}

/* 📄 Make Text Details More Compact */
#dashboardStats p {
    font-size: 12px;
    margin: 8px 0;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
}

/* 🖋 Add a separator for better readability */
#dashboardStats p:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

/* 🔽 Reduce Padding Inside the Modal */
#dashboardModal .modal-content {
    padding: 15px;
}


/* 🔔 Blinking Effect for Late Jobs */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.status-late {
    animation: blink 1s infinite;
}
#aiChatContainer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#aiChatInput {
    width: 300px;
    padding: 8px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-right: 5px;
}

#aiChatBtn {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

#aiChatResponse {
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
    color: #ffcc00;
}








.help-icon {
    font-size: 18px;
    cursor: pointer;
    margin-left: 5px;
    color: #ffcc00;
}

.help-icon:hover {
    color: #ffdb4d;
}

.popup {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #16213e;
    color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.3);
    z-index: 1000;
    width: 250px;
    text-align: center;
    font-size: 18px;
}

.popup-content h3 {
    margin-top: 0;
}

.close-popup {
    float: right;
    font-size: 20px;
    cursor: pointer;
}


.show-more-btn {
    display: inline-block;
    background: #007bff;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    margin-left: 5px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.show-more-btn:hover {
    background: #0056b3;
}


/* Truncate only the "Details" column */
.details-container {
    max-width: 200px; /* Adjust width as needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

/* When expanded, show full details */
.details-container.expanded {
    white-space: normal;
    overflow: visible;
}

/* 🔹 =====================================================================Control tabel sizign by boxes  Modernized Table Appearance */
table {
    width: 90% !important;
    margin: auto !important;
    border-collapse: separate !important;
    border-spacing: 0px 10px !important; /* Adds spacing between rows */
    background: #0f3460 !important;
    border-radius: 12px !important;
    overflow: hidden !important;

    font-size: 12px;
}

/* 🔹 Table Header */
thead {
    background: #1f2e4d !important;
    border-bottom: 3px solid #009688 !important; /* Teal separator */
}

thead th {
    padding: 15px !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    font-size: 14px !important;
    border-right: 1px solid #2e4964 !important; /* Vertical separators */
}

thead th:last-child {
    border-right: none !important;
}

/* 🔹 Table Body */
tbody td {
    padding: 12px !important;
    border-bottom: 2px solid #2e4964 !important; /* Darker separator */
    border-right: 1px solid #2e4964 !important;
    background: #112244 !important; /* Darker contrast for readability */
}





/* 🔹 Last Column - No Right Border */
tbody td:last-child {
    border-right: none !important;
}

/* 🔹 Modernized Buttons */
button {
    padding: 6px 10px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

/* 🔹 Improved "Show More" Button */
.show-more-btn {
    background: #007bff !important;
    color: white !important;
    font-size: 12px !important;
    padding: 3px 8px !important;
    margin-left: 5px !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
}

.show-more-btn:hover {
    background: #0056b3 !important;
}

/* 🔹 Borders Around Individual Cells */
tbody tr td {
    border-radius: 6px !important;
}

/* 🔹 Add Boxed Shadows for Individual Rows */
tbody tr {
    border-radius: 10px !important;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2) !important;
}

/* 🔹 Status Column - Bolder Appearance */
td.status-cell {
    font-weight: bold !important;
    text-transform: uppercase !important;
}

/* 🔹 Mobile Optimization */
@media (max-width: 768px) {
    table {
        width: 100% !important;
        border-spacing: 0 !important;
    }

    thead {
        display: none !important; /* Hide table headers */
    }

    tr {
        display: block !important;
        margin-bottom: 15px !important;
        border: 1px solid #006dda !important;
        border-radius: 10px !important;
        background: #1b1b3a !important;
        padding: 10px !important;
    }

    td {
        display: flex !important;
        justify-content: space-between !important;
        padding: 8px !important;
        border-bottom: 1px solid #333 !important;
    }

    td:last-child {
        border-bottom: none !important;
    }

    td:before {
        content: attr(data-label) !important;
        font-weight: bold !important;
        color: #5bc0be !important;
    }
}

/* Search Bar Container */
.search-container {
    position: relative;
    width: 300px;
    margin-bottom: 10px;
}

/* Search Input */
#searchBar {
    width: 100%;
    padding: 10px 40px 10px 15px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 25px;
    outline: none;
    transition: 0.3s;
}

/* Search Input Focus Effect */
#searchBar:focus {
    border-color: #4CAF50;
    box-shadow: 0px 0px 5px rgba(76, 175, 80, 0.5);
}

/* Search Icon */
.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    font-size: 18px;
}



/* ✅ AI Response Modal (Ensures No Interference) */
#aiResponseModal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    max-width: 500px;
    background: #f8f9fa; /* Light background */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-family: Arial, sans-serif;
}

/* 🏷️ Title Styling */
.ai-title {
    font-size: 22px;
    color: #007bff; /* Blue color for AI Title */
    font-weight: bold;
    margin-bottom: 10px;
}

/* 📜 Response Box */
.ai-response-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
    max-height: 250px; /* Limits long responses */
    overflow-y: auto; /* Scroll if too long */
    text-align: left;
}

/* 📝 Response Text */
#aiChatResponsePopup {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}

#aiResponseModal p {
    font-size: 18px; /* ✅ Make text readable */
    color: black; /* ✅ Ensure response is visible */
}


#aiResponseModal .modal-content {
    text-align: center;
    position: relative;
}

/* ❌ Close Button */

.close-ai {
    position: absolute;
    top: -10px;
    right: -5px;
    font-size: 24px; /* ✅ Make it big enough */
    font-weight: bold;
    cursor: pointer;
    color: #f50505; /* Dark gray for visibility */
    transition: color 0.3s ease-in-out;
}

.close-ai:hover {
    color: rgb(121, 8, 8);
}


/*----------------------------------------------FILTER LOGIC FOR TABLES--------------------------------------------*/

/* ✅ Enhanced Filter Dropdown Styling */
.filter-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px; /* Rounded corners */
    padding: 8px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2); /* Light shadow for better visibility */
    max-height: 250px; /* Prevents it from getting too long */
    overflow-y: auto;
    min-width: 180px; /* Ensures a proper width */
    font-family: Arial, sans-serif;
    color: black;
}

/* ✅ Style Each Filter Option */
.filter-option {
    padding: 8px 12px;
    cursor: pointer;
    text-align: left; /* Aligns text to the left */
    font-size: 14px;
    transition: background 0.2s ease-in-out;
    border-bottom: 1px solid #e0e0e0; /* Light separator */
}

/* ✅ Hover Effect */
.filter-option:hover {
    background: #007bff;
    color: white;
}

/* ✅ Last Item No Border */
.filter-option:last-child {
    border-bottom: none;
}

/* ✅ "Clear Filter" Option Styling */
.filter-option:first-child {
    font-weight: bold;
    color: red;
}
/* ✅ Adjust Filter Button Style */
th .filter-btn {
    order: -1; /* Moves button to the left */
    margin-right: 8px; /* Adds spacing between button and text */
    min-width: 24px; /* Keeps it visible */
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
}







/* 📱 **Improve Mobile Table Readability** */
@media (max-width: 768px) {
    table {
        width: 100% !important;
        display: block;
        overflow-x: auto;
        white-space: nowrap; /* ✅ Prevents text from wrapping */
    }

    thead {
        display: none !important; /* ✅ Hide table headers on mobile */
    }

    tbody,
    tr,
    td {
        display: block !important;
        width: 100% !important;
        text-align: left;
    }

    tr {
        border: 1px solid #006dda !important;
        margin-bottom: 10px;
        padding: 10px;
        background: #1b1b3a;
        border-radius: 8px;
    }

    td {
        display: flex !important;
        justify-content: space-between;
        padding: 8px;
        font-size: 14px;
        border-bottom: 1px solid #333;
        white-space: normal !important; /* ✅ Allow text to wrap instead of truncate */
        overflow: visible !important;
        text-overflow: clip !important;
    }

    td:last-child {
        border-bottom: none;
    }

    td:before {
        content: attr(data-label) !important;
        font-weight: bold;
        color: #5bc0be;
    }

    /* ✅ Ensure action buttons are aligned properly */
    .button-group {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
    }

    .button-group button {
        min-width: 100% !important; /* ✅ Make buttons take full width on mobile */
    }

    /* ✅ Ensure the Filter Button Stays Visible */
    .filter-btn {
        position: relative;
        left: 0 !important;
        margin-bottom: 5px;
    }

    /* ✅ Adjust filter dropdown */
    .filter-dropdown {
        position: absolute;
        left: 10px !important; /* ✅ Keeps it visible */
        right: auto;
        min-width: 160px !important;
    }
}

















/*========================================================================================================================== ✅ Force 'Done' row styling in all views */
@media screen and (min-width: 0px) {
    .force-done-style {
        background-color: #4CAF50 !important;
        color: white !important;
    }
    .force-done-style td {
        background-color: #4CAF50 !important; /* Ensures TDs also take the color */
        color: white !important;
    }
    
}
/* ✅ Force the Entire Row to Change Color for Late */


✅ Force Full Row Coloring for Each Status
tr.force-done-style td {
    background-color: #4CAF50 !important; 
    color: white !important;
}

tr.force-late-style td {
    background-color: #FF3B30 !important;
    color: white !important;
}

/*
tr.force-quoted-style td {
    background-color: #FFD700 !important;
    color: black !important;
}
tr.force-cancelled-style td {
    background-color: #808080 !important;
    color: white !important;
}
tr.force-awaiting-po-style td {
    background-color: #FFA500 !important; 
    color: #ffffff !important;
}
tr.force-not-started-style td {
    background-color: #1E90FF !important;
    color: white !important;
}
tr.force-in-process-style td {
    background-color: #0077B6 !important;
    color: white !important;
}
tr.force-vendor-issue-style td {
    background-color: #A020F0 !important;
    color: white !important;
}
tr.force-invoicing-style td {
    background-color: #00FA9A !important; 
    color: black !important;
}
tr.force-client-hold-style td {
    background-color: #DC143C !important;
    color: white !important;
}
tr.force-on-engineering-hold-style td {
    background-color: #8B0000 !important; 
    color: white !important;
}
tr.force-materials-ordered-style td {
    background-color: #32CD32 !important;
    color: black !important;
}
tr.force-materials-delayed-style td {
    background-color: #FF4500 !important; 
    color: white !important;
}
tr.force-waiting-on-delivery-style td {
    background-color: #4682B4 !important; 
    color: white !important;
}
tr.force-lack-of-support-style td {
    background-color: #800000 !important; 
    color: white !important;         
}*/
/* ✅ Smooth Row Highlighting */
/* ✅ Remove unwanted table flash effects */
/* ✅ Remove unwanted table flash effects */
/* ✅ Smooth Rolling Effect */
/* ✅ Ensure smooth, non-flashing scrolling */
/* ✅ Make scrolling fully seamless (no flashing) */

#itemsAdded {
    font-weight: bold;
    color: green;
    transition: transform 0.3s ease-in-out;
}

#itemsAdded.flash {
    transform: scale(1.3);
}

table td, table th {
    padding: 2px !important;
    font-size: 0.7em !important;
  }
  table {
    width: 100% !important;
  }
  .details-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Optional: consistent spacing between text and button */
  }
  
  .details-container {
    min-width: 200px;  /* Adjust this value to suit your layout */
    display: inline-block;
  }
  
  .show-more-btn {
    font-size: 0.9em;
    cursor: pointer;
  }
  
  .progress-circle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: Arial, sans-serif;
    margin-top: 15px;
    perspective: 500px; /* Creates 3D depth */
}

.progress-ring {
    transform: rotate(-90deg);
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
}

.progress-ring-bg {
    fill: none;
    stroke: #d3d3d3;
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: #4CAF50;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease-in-out;
    filter: drop-shadow(1px 2px 5px rgba(0, 255, 0, 0.5));
}

.progress-text {
    font-size: 18px;
    font-weight: bold;
    fill: #52f302;
    text-anchor: middle;
    dominant-baseline: middle;
    font-family: "Arial", sans-serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.progress-label {
    font-size: 14px;
    font-weight: bold;
    margin-top: 8px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
.chart-export-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #2c3e50;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
  }
  
  .chart-export-container label {
    color: #fff;
    font-weight: bold;
    margin-right: 10px;
  }
  
  .chart-buttons {
    display: flex;
    gap: 8px;
  }
  
  .chart-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s ease-in-out;
  }
  
  .chart-btn:hover {
    background: #2980b9;
  }
  
  .csv-btn {
    background: #2ecc71;
  }
  
  .csv-btn:hover {
    background: #27ae60;
  }

  
  @keyframes statusGlow {
    0% { background-color: #ffeb3b; }  /* Yellow */
    50% { background-color: #fffacd; } /* Lighter Yellow */
    100% { background-color: #ffeb3b; } 
}

.status-glow td {
    animation: statusGlow 1.5s infinite alternate;
}
.email-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 12px;  /* Small size */
    color: gray;       /* Subtle color */
    text-decoration: none;
    opacity: 0.5;      /* Slightly hidden */
    transition: opacity 0.3s ease;
}

.email-icon:hover {
    opacity: 1;  /* Fully visible on hover */
    color: #00467F; /* Matches IMC color */
}


