body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Header Layout */
.header-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 0;
    min-height: 80px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.header-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-center {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 20px;
}

.header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    max-width: 320px;
    min-width: 0;
}

.dps-logo {
    height: 60px;
    width: auto;
    max-width: 150px;
}

h1 {
    color: #333;
    margin: 0;
    font-size: 2.2em;
}

/* System Status Header */
.system-status-header {
    margin: 0;
    padding: 6px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    overflow: hidden;
}

.status-modules {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
}

.module-status {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 7px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.module-status:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.module-name {
    color: white;
    font-weight: 500;
    font-size: 0.7rem;
}

.status-indicator {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.status-indicator[data-status="running"], 
.status-indicator[data-status="connected"],
.status-indicator[data-status="idle"] {
    color: #10b981; /* Green */
}

.status-indicator[data-status="connecting"], 
.status-indicator[data-status="starting"],
.status-indicator[data-status="processing"],
.status-indicator[data-status="scanning"] {
    color: #f59e0b; /* Yellow */
}

.status-indicator[data-status*="error"], 
.status-indicator[data-status*="failed"],
.status-indicator[data-status*="critical"] {
    color: #ef4444; /* Red */
}

.status-indicator[data-status="unknown"] {
    color: #6b7280; /* Gray */
}

.status-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.65rem;
    font-weight: 400;
}

/* Responsive Header */
@media (max-width: 1200px) {
    .header-right {
        max-width: 300px;
    }
    
    .status-modules {
        gap: 5px;
    }
    
    .module-status {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .module-name {
        font-size: 0.65rem;
    }
    
    .status-text {
        font-size: 0.6rem;
    }
}

@media (max-width: 768px) {
    .header-layout {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-left, .header-center, .header-right {
        flex: none;
        max-width: 100%;
    }
    
    .system-status-header {
        padding: 6px 10px;
    }
    
    .status-modules {
        justify-content: center;
        gap: 8px;
    }
}

.filter-container {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #e9e9e9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 20px; /* Add some space between filter groups */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.filter-container > div { /* Style for the direct div children of filter-container */
    display: flex;
    align-items: center;
    gap: 5px; /* Space between label and input/select */
}

.filter-container label {
    margin-right: 5px; /* Adjusted margin */
    font-weight: bold;
}

.filter-container select,
.filter-container input[type="text"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    min-width: 180px; /* Adjusted min-width */
}

.filter-container input[type="text"] {
    box-sizing: border-box; /* Ensure padding and border don't increase width */
}

#jobsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

#jobsTable th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    cursor: pointer; /* Indicate headers are clickable */
    position: relative; /* For positioning sort arrows */
}

#jobsTable th .sort-arrow {
    font-size: 0.8em;
    margin-left: 5px;
}

/* Alternative: Use ::after pseudo-element for arrows if preferred, requires more complex content switching in JS */
/*
#jobsTable th.sort-asc::after {
    content: ' \25B2'; // Up arrow Unicode
}
#jobsTable th.sort-desc::after {
    content: ' \25BC'; // Down arrow Unicode
}
*/

#jobsTable tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#jobsTable tbody tr:hover {
    background-color: #f1f1f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Job number styling */
#jobsTable .job-number {
    font-weight: 600;
    color: #4e73df;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9em;
}

.status-waiting {
    background-color: #d4edda; /* Retaining original color, can be changed if 'waiting' needs a different style */
    color: #155724;
}

.status-missing {
    background-color: #f8d7da;
    color: #721c24;
}

.status-imposing {
    background-color: #cce5ff;
    color: #004085;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 64, 133, 0.2);
    border: 1px solid #b8daff;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(21, 87, 36, 0.2);
    border: 1px solid #c3e6cb;
}

/* Add styling for imposing rows */
.status-imposing-row {
    background-color: #f0f7ff !important;
    border-left: 4px solid #007bff;
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.2);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.status-scheduled {
    background-color: #fff3cd;
    color: #856404;
}

.status-imposed {
    background-color: #d1ecf1; /* Light blue/cyan */
    color: #0c5460;
}

.status-not-handled {
    background-color: #e2e3e5; /* Light grey */
    color: #383d41;
}

/* Ships In status indicators */
.ships-in-indicator {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    min-width: 60px;
}

.ships-overdue {
    background-color: #f8d7da; /* Light red */
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ships-urgent {
    background-color: #fff3cd; /* Light yellow */
    color: #856404;
    border: 1px solid #ffeaa7;
}

.ships-soon {
    background-color: #d1ecf1; /* Light blue */
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.ships-normal {
    background-color: #d4edda; /* Light green */
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ships-in-cell {
    text-align: center;
    white-space: nowrap;
}

/* Apply same date display format to jobs table */
#jobsTable .date-display {
    display: flex;
    flex-direction: column;
}

#jobsTable .date-primary {
    font-weight: 600;
}

#jobsTable .date-secondary {
    font-size: 0.85em;
    color: #6c757d;
}

#loadingMessage, #errorMessage {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    font-size: 1.1em;
}

.error-message {
    color: #d9534f; /* Red for errors */
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    border-radius: 4px;
}
/* View Switcher Styles */
.view-switcher {
    margin-bottom: 20px;
    text-align: center;
}

.view-switcher button {
    padding: 10px 15px;
    margin: 0 5px;
    border: 1px solid #007bff;
    background-color: #f8f9fa;
    color: #007bff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1em;
}

.view-switcher button.active {
    background-color: #007bff;
    color: white;
}

/* Potential Impositions View Styles */
#potentialImpositionsView h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

#potentialImpositionsView .controls-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
    max-width: 100%;
}

.partid-controls-header { /* New style for the wrapper */
    display: flex;
    flex-direction: row; /* Arrange children horizontally */
    align-items: flex-start; /* Align items to the start of the cross axis */
    gap: 20px; /* Space between part selection and button */
    flex-wrap: wrap; /* Allow wrapping if space is insufficient */
}

#potentialImpositionsView .part-selection-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center label and button container */
    gap: 10px;
    flex-grow: 1; /* Allow part selection to take available space */
}

#partIdButtonsContainer { /* Ensure buttons themselves can be centered if they wrap */
    justify-content: center;
}

#settingsButtonContainer {
    /* margin-bottom: 15px; */ /* Removed to align with flex layout */
    align-self: center; /* Vertically center button if part-selection is taller */
}


/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: #f0f8ff;
    margin: 5% auto; /* Reduced from 10% to 5% to position higher */
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #b8daff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 600px; /* Increased from 500px to 600px for more room */
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #0056b3;
}

#settingsButtonContainer {
    margin-bottom: 15px;
}

.settings-btn {
    background-color: #20c997; /* Teal color */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.settings-btn:hover {
    background-color: #1baa80; /* Darker teal for hover */
}

#potentialImpositionsView #partSettingsContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#potentialImpositionsView #partSettingsContainer h3 {
    color: #0056b3;
    font-size: 1.1em;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #b8daff;
}

#potentialImpositionsView #partSettingsContainer div {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#potentialImpositionsView #partSettingsContainer label {
    width: 200px;
    margin-right: 10px;
}

#potentialImpositionsView #partSettingsContainer input[type="number"] {
    max-width: 120px;
}

#savePartSettingsBtn {
    margin-top: 10px;
    align-self: flex-start;
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#savePartSettingsBtn:hover {
    background-color: #218838;
}

#potentialImpositionsView label {
    font-weight: bold;
    margin-bottom: 5px;
}

#potentialImpositionsView select,
#potentialImpositionsView input[type="number"],
#potentialImpositionsView button {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1em;
}

#potentialImpositionsView select {
    min-width: 250px;
}

#potentialImpositionsView input[type="number"] {
    width: auto; /* Adjust width automatically */
    max-width: 200px; /* Max width for the input */
    box-sizing: border-box;
}


#potentialImpositionsView #partSettingsContainer h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #555;
}

#potentialImpositionsView button {
    background-color: #28a745;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

#potentialImpositionsView button:hover {
    background-color: #218838;
}

#potentialImpositionResults {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* New styles for improved imposition layout */
.form-result {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}

.imposition-data {
    flex: 1 1 60%;
    min-width: 300px;
}

.layout-diagram-container {
    flex: 1 1 30%;
    min-width: 200px;
}

#potentialImpositionResults h3 {
    color: #333;
    margin-top: 0;
}
#potentialImpositionResults h4 {
    color: #007bff;
    margin-top: 15px;
    margin-bottom: 10px;
}

#potentialImpositionResults .form-result {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fdfdfd;
}

#potentialImpositionResults ul {
    list-style-type: disc;
    margin-left: 20px;
}

#potentialImpositionResults li {
    margin-bottom: 5px;
}

/* Layout Diagram Styles (adapted from demo) */
.layout-diagram {
    margin-top: 0;
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    overflow-x: auto; /* For smaller screens if table is wide */
    max-width: 100%;
}

.layout-diagram table {
    width: auto; /* Let table size to content */
    min-width: 200px; /* Minimum width */
    border-collapse: collapse;
    margin: 0 auto; /* Center the table if it's narrower than container */
}

.layout-diagram th, .layout-diagram td {
    border: 1px solid #aaa;
    padding: 6px;
    text-align: center;
    min-width: 30px; /* Smaller cells */
    height: 30px;
    font-size: 0.9em;
}

.layout-diagram td.empty-slot {
    background-color: #e9e9e9;
    color: #aaa;
}

#potentialImpositionLoadingMessage,
#potentialImpositionErrorMessage {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    font-size: 1.1em;
}

#potentialImpositionErrorMessage {
    color: #d9534f; /* Red for errors */
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    border-radius: 4px;
}
/* Styles for Part ID Buttons */
#partIdButtonsContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.part-id-btn {
    position: relative;
    padding: 12px 18px;
    border: 1px solid #007bff;
    background-color: #f8f9fa;
    color: #007bff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 140px;
    margin: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.part-id-btn:hover {
    background-color: #e2e6ea;
    border-color: #0056b3;
}

.part-id-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

#clearSearchBtn {
    padding: 8px 12px;
    border: 1px solid #6c757d; /* Secondary button style */
    background-color: #6c757d;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease-in-out;
}

#clearSearchBtn:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* --- Impositions Styles --- */

/* Impositions View Header */
#impositionsView h2 {
    color: #4e73df;
    font-size: 1.5em;
    margin: 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3e6f0;
    text-align: center;
}

/* Impositions Table */
#impositionsTable, #completedImpositionsTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
}

#impositionsTable th, #completedImpositionsTable th,
#impositionsTable td, #completedImpositionsTable td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e3e6f0;
}

#impositionsTable tr:last-child td,
#completedImpositionsTable tr:last-child td {
    border-bottom: none;
}

#impositionsTable th, #completedImpositionsTable th {
    background-color: #4e73df;
    color: white;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    font-size: 0.95em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

#impositionsTable th:hover, #completedImpositionsTable th:hover {
    background-color: #3a5cc5;
}

#impositionsTable th .sort-arrow, #completedImpositionsTable th .sort-arrow {
    margin-left: 5px;
}

#impositionsTable tbody tr:nth-child(even), #completedImpositionsTable tbody tr:nth-child(even) {
    background-color: #f8f9fc;
}

#impositionsTable tbody tr, #completedImpositionsTable tbody tr {
    transition: all 0.2s ease;
}

#impositionsTable tbody tr:hover, #completedImpositionsTable tbody tr:hover {
    background-color: #eaecf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
    position: relative;
}

/* Improved Action Buttons */
.actions-cell {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    white-space: nowrap;
}

.action-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-info-btn {
    background-color: #4e73df;
    color: white;
}

.view-info-btn:hover {
    background-color: #3a5cc5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(78, 115, 223, 0.3);
}

.action-btn:nth-child(2) { /* Download PDF button */
    background-color: #36b9cc;
    color: white;
}

.action-btn:nth-child(2):hover {
    background-color: #2c969d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(54, 185, 204, 0.3);
}

/* Delete button styles */
.delete-stuck-btn {
    background-color: #e74a3b !important;
    color: white !important;
}

.delete-stuck-btn:hover {
    background-color: #c0392b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 74, 59, 0.3);
}

.delete-imposition-btn,
.modal-action-btn-destructive {
    background-color: #dc3545 !important;
    color: white !important;
}

.delete-imposition-btn:hover,
.modal-action-btn-destructive:hover {
    background-color: #c82333 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Mark Complete button styles */
.mark-complete-btn {
    background-color: #28a745 !important;
    color: white !important;
}

.mark-complete-btn:hover {
    background-color: #218838 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Download button styles */
.download-btn {
    background-color: #36b9cc !important;
    color: white !important;
}

.download-btn:hover {
    background-color: #2c969d !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(54, 185, 204, 0.3);
}

/* Imposition Info Modal Styling */
#impositionInfoModal .modal-content {
    max-width: 700px;
    width: 90%;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}

#impositionInfoModal h3 {
    background-color: #4e73df;
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 1.3em;
}

#impositionInfoModal h4 {
    color: #4e73df;
    margin: 20px 0 10px;
    border-bottom: 1px solid #e3e6f0;
    padding-bottom: 8px;
}

#modalImpositionBatchInfo,
#modalImpositionJobsInfo,
#modalImpositionLogContent {
    padding: 0 20px;
}

#modalImpositionBatchInfo {
    padding-top: 20px;
}

#modalImpositionJobsInfo table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 20px;
}

#modalImpositionJobsInfo th,
#modalImpositionJobsInfo td {
    padding: 8px;
    border: 1px solid #e3e6f0;
    text-align: left;
}

#modalImpositionJobsInfo th {
    background-color: #f8f9fc;
    font-weight: 600;
}

#modalImpositionLogContent {
    background-color: #f8f9fc;
    border: 1px solid #e3e6f0;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
    margin: 0 20px 20px;
    border-radius: 4px;
}

/* PDF Status Styling */
.pdf-status {
    margin-top: 10px;
}

.pdf-note {
    color: #6c757d;
    font-style: italic;
    margin-top: 5px;
    font-size: 0.9em;
    background-color: #f8f9fc;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #cce5ff;
}

/* Improved Loading and Error Messages */
#loadingMessage,
#errorMessage,
#impositionsLoadingMessage,
#impositionsErrorMessage,
#completedImpositionsLoadingMessage,
#completedImpositionsErrorMessage {
    text-align: center;
    padding: 15px;
    margin: 20px auto;
    max-width: 600px;
    border-radius: 8px;
    font-size: 1em;
    animation: fadeIn 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Success message */
#loadingMessage,
#potentialImpositionLoadingMessage,
#impositionsLoadingMessage,
#completedImpositionsLoadingMessage {
    background-color: #cce5ff;
    border: 1px solid #b8daff;
    color: #004085;
}

/* Error message */
.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Potential impositions message styling */
#potentialImpositionLoadingMessage,
#potentialImpositionErrorMessage {
    text-align: center;
    padding: 15px;
    margin: 0 0 20px 0;
    max-width: 100%;
    border-radius: 4px;
    font-size: 1em;
    animation: fadeIn 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Success notification */
.success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
    border-radius: 4px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.success-notification .notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
}

.success-notification .notification-content {
    margin-bottom: 5px;
}

.success-notification .notification-close {
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Status message styling */
.status-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

/* Enhanced Completed Impositions Table */
#impositionsTable .form-id-cell,
#completedImpositionsTable .form-id-cell {
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
    background-color: #f8f9fc;
    border-right: 1px solid #e3e6f0;
}

#impositionsTable .highlight-text,
#completedImpositionsTable .highlight-text {
    font-weight: 600;
    color: #4e73df;
    padding: 3px 8px;
    background-color: #eaedfc;
    border-radius: 4px;
    display: inline-block;
}

#impositionsTable .job-count,
#completedImpositionsTable .job-count {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-align: center;
    min-width: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#impositionsTable .high-count,
#completedImpositionsTable .high-count {
    background-color: #4e73df;
    color: white;
    box-shadow: 0 2px 4px rgba(78, 115, 223, 0.3);
}

#impositionsTable .medium-count,
#completedImpositionsTable .medium-count {
    background-color: #36b9cc;
    color: white;
    box-shadow: 0 2px 4px rgba(54, 185, 204, 0.3);
}

#impositionsTable .low-count,
#completedImpositionsTable .low-count {
    background-color: #f8f9fc;
    color: #4e73df;
    border: 1px solid #4e73df;
    box-shadow: 0 2px 4px rgba(78, 115, 223, 0.1);
}

#impositionsTable .date-display,
#completedImpositionsTable .date-display {
    display: flex;
    flex-direction: column;
    background-color: #f8f9fc;
    padding: 4px 8px;
    border-radius: 4px;
}

#impositionsTable .date-primary,
#completedImpositionsTable .date-primary {
    font-weight: 600;
    color: #4e73df;
}

#impositionsTable .date-secondary,
#completedImpositionsTable .date-secondary {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 2px;
}

#impositionsTable .imposition-row,
#completedImpositionsTable .imposition-row {
    transition: all 0.3s ease;
}

#impositionsTable .imposition-row:hover,
#completedImpositionsTable .imposition-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px;
    background-color: #f8f9fc;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.empty-icon {
    font-size: 4em;
    color: #b8c2cc;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-text {
    font-size: 1.4em;
    font-weight: 600;
    color: #4e73df;
    margin-bottom: 10px;
}

.empty-subtext {
    color: #6c757d;
    font-size: 1em;
    text-align: center;
    max-width: 400px;
}

.info-icon, .pdf-icon {
    margin-right: 6px;
    font-style: normal;
    font-size: 1.1em;
}

/* Enhanced modal styles */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 10px;
}

#modalImpositionJobsInfo table {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.3s;
}

#modalImpositionJobsInfo .job-number {
    font-weight: 600;
    color: #4e73df;
}

#modalImpositionJobsInfo .filename-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#modalImpositionJobsInfo .quantity-cell {
    text-align: right;
}

#modalImpositionJobsInfo .num-up-badge {
    display: inline-block;
    background-color: #f8f9fc;
    color: #4e73df;
    border: 1px solid #4e73df;
    border-radius: 12px;
    padding: 2px 8px;
    font-weight: 600;
    text-align: center;
    min-width: 30px;
}

/* Status message styling */
.status-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.status-message.success {
    color: #155724;
}

.status-message.error {
    color: #721c24;
}

.status-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: relative;
}

.status-icon.sending {
    border: 3px solid #cce5ff;
    border-top-color: #007bff;
    animation: spin 1s linear infinite;
}

.status-icon.success {
    background-color: #28a745;
}

.status-icon.success:after {
    content: '';
    position: absolute;
    top: 5px;
    left: 8px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.status-icon.error {
    background-color: #dc3545;
}

.status-icon.error:after {
    content: '✕';
    position: absolute;
    top: -2px;
    left: 5px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.detail-text {
    font-size: 0.9em;
    opacity: 0.8;
}

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

.sending-state {
    position: relative;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}
/* Notification Count Badge Styles */
.notification-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #dc3545;
    color: white;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 0.85em;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    margin-left: 5px;
    transition: all 0.2s ease;
}

/* Style for the active button notification bubble */
.part-id-btn.active .notification-bubble {
    background-color: white;
    color: #007bff;
}
/* Horizontal Part Settings Styles */
.inline-settings-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    background-color: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    animation: fadeIn 0.3s;
}

.settings-header {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    border-bottom: 1px solid #e3e6f0;
    padding-bottom: 8px;
}

.settings-header h4 {
    color: #4e73df;
    margin: 0;
    font-size: 1.1em;
}

.settings-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e3e6f0;
}

.settings-group label {
    font-weight: 600;
    color: #5a5c69;
    font-size: 0.9em;
    white-space: nowrap;
}

.settings-group input {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid #d1d3e2;
    border-radius: 4px;
    text-align: center;
}

.settings-actions {
    margin-left: auto;
}

.save-settings-btn {
    background-color: #4e73df;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(78, 115, 223, 0.1);
}

.save-settings-btn:hover {
    background-color: #2e59d9;
    box-shadow: 0 4px 8px rgba(78, 115, 223, 0.2);
}
/* Logs View Specific Styles */
#logsView .filter-controls-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 20px;
}

#logsView .filter-controls-group > div {
    display: flex;
    align-items: center;
    gap: 5px;
}

#logsView label {
    font-weight: normal;
    margin-right: 5px;
}

#logsView input[type="date"],
#logsView input[type="text"],
#logsView select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#logsView input[type="text"] {
    min-width: 200px;
}

#logsView button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#logsView button:hover {
    background-color: #0056b3;
}

#logEntriesContainer {
    margin-top: 20px;
    max-height: 600px; /* Adjust as needed */
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th,
.logs-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 0.9em;
    vertical-align: top;
}

.logs-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1; /* Ensure header stays above scrolling content */
}

.logs-table td pre {
    margin: 0;
    white-space: pre-wrap; /* Wrap long log messages */
    word-break: break-all; /* Break long words/strings */
    font-family: monospace;
}

/* Log Level Specific Styling */
.log-level-debug { color: #6c757d; } /* Gray */
.log-level-info { color: #17a2b8; } /* Teal */
.log-level-warning { color: #ffc107; } /* Yellow */
.log-level-error { color: #dc3545; } /* Red */
.log-level-critical { color: #dc3545; font-weight: bold; } /* Bold Red */

#logsView .pagination-controls {
    margin-top: 15px;
    text-align: center;
}

#logsView .pagination-controls button {
    margin: 0 5px;
}

#logsView .no-data-message {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

#logsLoadingMessage, #logsErrorMessage {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    font-size: 1.1em;
}
/* Configuration View Styles */
.config-tabs {
    display: flex;
    border-bottom: 2px solid #e3e6f0;
    margin-bottom: 20px;
}

.config-tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.config-tab-btn:hover {
    color: #495057;
    background-color: #f8f9fa;
}

.config-tab-btn.active {
    color: #4e73df;
    border-bottom-color: #4e73df;
    background-color: #f8f9fc;
}

.config-tab-content {
    min-height: 400px;
}

.config-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e3e6f0;
}

.config-section-header h3 {
    margin: 0;
    color: #2c3e50;
}

.config-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.config-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.config-table th {
    background-color: #f8f9fc;
    color: #2c3e50;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #e3e6f0;
}

.config-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e3e6f0;
    vertical-align: middle;
}

.config-table tr:hover {
    background-color: #f8f9fa;
}

.config-table .no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
}

.config-table .actions {
    white-space: nowrap;
}

.config-table .actions .btn {
    margin-right: 5px;
}

/* Responsive Design for Configuration */
@media (max-width: 768px) {
    .config-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .config-table-container {
        overflow-x: auto;
    }
    
    .config-table {
        min-width: 600px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Solver View Styles */
.solver-overview {
    padding: 20px 0;
}

.solver-status-card {
    background-color: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.solver-status-card h4 {
    margin-top: 0;
    color: #4e73df;
}

.solver-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.summary-card {
    background-color: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #5a5c69;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 2rem;
    font-weight: bold;
    color: #4e73df;
    margin-bottom: 5px;
}

.summary-detail {
    color: #858796;
    font-size: 0.8rem;
}

.solver-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.solver-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e3e6f0;
}

.solver-tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: #5a5c69;
    transition: all 0.2s ease;
}

.solver-tab-btn:hover {
    color: #4e73df;
    background-color: #f8f9fc;
}

.solver-tab-btn.active {
    color: #4e73df;
    border-bottom-color: #4e73df;
    font-weight: 600;
}

.solver-tab-content {
    min-height: 400px;
}

.stock-groups-section {
    padding: 20px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    color: #5a5c69;
}

.stock-groups-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.stock-groups-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    overflow: hidden;
}

.stock-groups-table th,
.stock-groups-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e3e6f0;
}

.stock-groups-table th {
    background-color: #f8f9fc;
    font-weight: 600;
    color: #5a5c69;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-groups-table tbody tr:hover {
    background-color: #f8f9fc;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-ready {
    background-color: #d4edda;
    color: #155724;
}

.status-incomplete {
    background-color: #fff3cd;
    color: #856404;
}

.calculation-result {
    background-color: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.calculation-result h4 {
    margin-top: 0;
    color: #4e73df;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.result-metric {
    background-color: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.result-metric label {
    display: block;
    font-size: 0.8rem;
    color: #858796;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4e73df;
}

.jobs-per-sheet,
.layout-info {
    margin: 20px 0;
}

.jobs-per-sheet h5,
.layout-info h5 {
    color: #5a5c69;
    margin-bottom: 10px;
}

.jobs-per-sheet-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e3e6f0;
    border-radius: 6px;
    overflow: hidden;
}

.jobs-per-sheet-table th,
.jobs-per-sheet-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e3e6f0;
}

.jobs-per-sheet-table th {
    background-color: #f8f9fc;
    font-weight: 600;
    color: #5a5c69;
}

.layout-info pre {
    background-color: #f8f9fa;
    border: 1px solid #e3e6f0;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
    font-size: 0.85rem;
    color: #5a5c69;
}

.solver-modal .modal-content {
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.jobs-table th,
.jobs-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e3e6f0;
}

.jobs-table th {
    background-color: #f8f9fc;
    font-weight: 600;
    color: #5a5c69;
    font-size: 0.8rem;
}

.calculations-section {
    padding: 20px 0;
}

.calculations-section h3 {
    color: #5a5c69;
    margin-bottom: 20px;
}

/* WM Mappings specific styles */
.wm-mappings-search {
    margin-bottom: 20px;
}

.wm-mappings-search .search-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
}

.status-active {
    color: #28a745;
    font-weight: 500;
}

.status-inactive {
    color: #dc3545;
}

/* Imposition Modal Styles */
.imposition-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.imposition-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.imposition-modal-container {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.imposition-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.imposition-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.imposition-modal-header .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.imposition-modal-header .close-btn:hover {
    color: #000;
}

.imposition-modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.imposition-results .summary {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.production-run {
    margin-bottom: 2rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
}

.production-run h5 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.run-details {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.run-details span {
    display: flex;
    align-items: center;
}

.create-imposition-btn {
    margin: 10px 0;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.create-imposition-btn:hover {
    background-color: #0056b3;
}

.create-imposition-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.svg-container {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.svg-container svg {
    max-width: 100%;
    height: auto;
}

.all-layouts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.layout-option {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.5rem;
}

.layout-stats {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.svg-container.small {
    padding: 0.5rem;
}

.svg-container.small svg {
    max-height: 150px;
}

.remaining-jobs {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.remaining-jobs li {
    padding: 0.25rem 0;
    color: #e74c3c;
}

.imposition-modal-content .loading,
.imposition-modal-content .error {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
}

.imposition-modal-content .error {
    color: #e74c3c;
}

/* Placer optimization results */
.placer-results {
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f8ff;
    border: 1px solid #b0d4ff;
    border-radius: 5px;
}

.placer-results h4 {
    margin-top: 0;
    color: #0066cc;
}

.optimization-details p {
    margin: 5px 0;
}

.job-placements {
    list-style-type: none;
    padding-left: 20px;
}

.job-placements li {
    margin: 3px 0;
    padding: 2px 5px;
    background-color: #e8f3ff;
    border-radius: 3px;
    display: inline-block;
    margin-right: 10px;
}

.waste-analysis {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

.waste-analysis th {
    background-color: #0066cc;
    color: white;
}

.waste-analysis tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Custom test section */
.custom-test-section {
    background-color: #f8f9fa;
    max-width: 800px;
}

.custom-test-section h3 {
    margin-top: 0;
    color: #333;
}

.custom-test-controls label {
    font-weight: 600;
    margin-right: 10px;
}

.custom-job-entry {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.custom-job-entry input {
    padding: 3px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.remove-job-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-weight: bold;
}

.remove-job-btn:hover {
    background-color: #c82333;
}

#customTestResults .success {
    padding: 15px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    color: #155724;
}

#customTestResults .error {
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
}

/* Page group header styles update */
.page-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-group-header button {
    margin-left: 1rem;
    font-weight: 500;
}

/* Job candidates search controls */
.job-candidates-controls .search-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.sheet-size-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sheet-size-controls input[type="number"] {
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
}

.sheet-size-controls label {
    font-weight: 500;
    color: #495057;
}

/* Imposition Modal Additional Styles */
.imposition-results {
    padding: 1rem;
}

.production-run {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.production-run h5 {
    margin-top: 0;
    color: #333;
}

.run-details {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.run-details span {
    padding: 0.25rem 0.5rem;
    background: #f0f0f0;
    border-radius: 4px;
}

.svg-container {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
    background: #fafafa;
    overflow: auto;
    max-height: 400px;
}

.svg-container svg {
    display: block;
    margin: 0 auto;
}

.svg-container.small {
    max-height: 200px;
    padding: 0.5rem;
}

.remaining-jobs {
    list-style: none;
    padding: 0;
}

.remaining-jobs li {
    padding: 0.5rem;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.create-imposition-btn {
    margin-top: 10px;
}

/* Custom Test Section Styles */
.custom-test-section {
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
}

.custom-test-section h3 {
    margin-top: 0;
    color: #4e73df;
    font-size: 1.2rem;
}

.custom-test-section p {
    color: #666;
    margin-bottom: 20px;
}

.custom-test-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sheet-size-section label,
.jobs-section label {
    font-weight: 600;
    color: #5a5c69;
    margin-right: 10px;
}

.custom-job-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.custom-job-entry input {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 3px;
}

.remove-job-btn {
    background: #e74a3b;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-job-btn:hover {
    background: #c82333;
}

#customTestResults .success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 4px;
}

#customTestResults .success h4 {
    margin-top: 0;
    color: #155724;
}

/* All Layouts Display */
.all-layouts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.layout-option {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    background: white;
}

.layout-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.layout-stats span {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Placer Results */
.placer-results {
    background: #e8f4f8;
    border: 1px solid #b8e0e8;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.placer-results h4 {
    margin-top: 0;
    color: #0277bd;
}

.optimization-details {
    font-size: 0.9rem;
}

.optimization-details p {
    margin: 5px 0;
}

.job-placements {
    list-style: none;
    padding-left: 20px;
}

.job-placements li {
    padding: 3px 0;
}

.waste-analysis {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.85rem;
}

.waste-analysis th,
.waste-analysis td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.waste-analysis th {
    background: #f0f0f0;
    font-weight: 600;
}

/* Knapsack Solver Styles */
.knapsack-test-section {
    background-color: #f9f9f9;
}

.knapsack-test-section h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.knapsack-test-section h4 {
    color: #34495e;
    margin-top: 0;
    margin-bottom: 10px;
}

.capacity-entry, .knapsack-job-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.capacity-entry input, .knapsack-job-entry input {
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 3px;
}

.remove-capacity-btn, .remove-knapsack-job-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-weight: bold;
}

.remove-capacity-btn:hover, .remove-knapsack-job-btn:hover {
    background-color: #c0392b;
}

.knapsack-results {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.knapsack-results h4 {
    color: #2c3e50;
    margin-top: 0;
}

.knapsack-results h5 {
    color: #34495e;
    margin-top: 20px;
    margin-bottom: 10px;
}

.result-summary {
    background-color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.result-summary p {
    margin: 5px 0;
}

.knapsack-assignments {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.knapsack-assignments th {
    background-color: #34495e;
    color: white;
    padding: 10px;
    text-align: left;
}

.knapsack-assignments td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.knapsack-assignments tr:hover {
    background-color: #f5f5f5;
}

.layout-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.layout-option.selectable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.layout-option.selectable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.layout-header {
    background-color: #ecf0f1;
    padding: 10px;
    border-radius: 5px 5px 0 0;
}

.layout-header h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.job-counts {
    padding: 10px;
    background-color: #f9f9f9;
    font-size: 0.9em;
}

.job-counts span {
    display: inline-block;
    margin-right: 10px;
    color: #7f8c8d;
}

.selected-layout {
    border: 2px solid #3498db;
    padding: 15px;
    border-radius: 5px;
    background-color: #ecf0f1;
}

.layout-preview {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.svg-container.medium {
    max-width: 300px;
}

/* Jobs summary table */
.jobs-summary {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.jobs-summary h4 {
    margin-top: 0;
    color: #2c3e50;
}

.jobs-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.jobs-summary-table th,
.jobs-summary-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.jobs-summary-table th {
    background-color: #e9ecef;
    font-weight: 600;
}

/* Best layouts section */
.best-layouts-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 8px;
}

.best-layouts-section h4 {
    margin-top: 0;
    color: #2e7d32;
}

/* Partial fit styling */
.best-layouts-section.partial-fit {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.best-layouts-section.partial-fit h4 {
    color: #856404;
}

.best-layouts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* Layout card enhancements */
.layout-option.optimal {
    border: 2px solid #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.layout-option.has-knapsack {
    background-color: #fafafa;
}

.layout-option h5 {
    margin: 0;
    font-size: 1rem;
}

.knapsack-summary {
    display: flex;
    justify-content: space-around;
    background-color: #e3f2fd;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.knapsack-metric {
    text-align: center;
}

.knapsack-metric .metric-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
}

.knapsack-metric .metric-value {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
    color: #1976d2;
}

.assignment-details {
    margin-top: 10px;
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
}

.assignment-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.mini-assignments {
    width: 100%;
    margin-top: 8px;
    font-size: 0.85rem;
}

.mini-assignments th,
.mini-assignments td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.mini-assignments th {
    background-color: #f5f5f5;
    font-weight: 600;
}

/* Layout actions buttons */
.layout-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.create-imposition-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.create-imposition-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.create-imposition-btn:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Prepress Dashboard Styles */
.prepress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    border-bottom: 2px solid #e3e6f0;
    padding-bottom: 10px;
}

.prepress-tabs {
    display: flex;
}

.prepress-tab-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.prepress-tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: #5a5c69;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.prepress-tab-btn:hover {
    color: #4e73df;
    background-color: #f8f9fc;
}

.prepress-tab-btn.active {
    color: #4e73df;
    border-bottom-color: #4e73df;
    background-color: #f8f9fc;
}

.prepress-section {
    margin-top: 0;
}

.prepress-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fc;
    border-radius: 8px;
    border: 1px solid #e3e6f0;
}

.prepress-summary {
    font-size: 1.1em;
    font-weight: 500;
    color: #5a5c69;
}

.stock-section {
    margin-bottom: 20px;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stock-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.stock-header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.stock-header.expanded {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.stock-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.stock-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

.toggle-icon {
    font-size: 1.2em;
    transition: transform 0.2s ease;
}

.stock-jobs {
    padding: 20px;
    background-color: #fff;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.jobs-table th,
.jobs-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e3e6f0;
}

.jobs-table th {
    background-color: #f8f9fc;
    font-weight: 600;
    color: #5a5c69;
    position: sticky;
    top: 0;
}

.jobs-table tbody tr:hover {
    background-color: #f8f9fc;
}

/* Priority badges */
.priority-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-badge.high {
    background-color: #e74c3c;
    color: white;
}

.priority-badge.medium {
    background-color: #f39c12;
    color: white;
}

.priority-badge.low {
    background-color: #27ae60;
    color: white;
}

.priority-badge.unknown {
    background-color: #95a5a6;
    color: white;
}

/* Job row priority styling */
.job-row.high-priority {
    border-left: 4px solid #e74c3c;
}

.job-row.medium-priority {
    border-left: 4px solid #f39c12;
}

.job-row.low-priority {
    border-left: 4px solid #27ae60;
}

/* Urgency styling */
.urgency.overdue {
    color: #e74c3c;
    font-weight: 600;
}

.urgency.urgent {
    color: #fd7e14;
    font-weight: 600;
}

.urgency.soon {
    color: #ffc107;
    font-weight: 500;
}

/* Age styling */
.age.old {
    color: #e74c3c;
    font-weight: 500;
}

.age.aging {
    color: #fd7e14;
}

.no-data,
.no-jobs {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Ready impositions styles */
.impositions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.impositions-table th,
.impositions-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e3e6f0;
}

.impositions-table th {
    background-color: #f8f9fc;
    font-weight: 600;
    color: #5a5c69;
    position: sticky;
    top: 0;
}

.impositions-table tbody tr:hover {
    background-color: #f8f9fc;
}

.imposition-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.imposition-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.status-indicator {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-NEW {
    background-color: #28a745;
    color: white;
}

/* Responsive design for prepress view */
@media (max-width: 768px) {
    .stock-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stock-summary {
        flex-wrap: wrap;
    }
    
    .jobs-table,
    .impositions-table {
        font-size: 0.9em;
    }
    
    .jobs-table th,
    .jobs-table td,
    .impositions-table th,
    .impositions-table td {
        padding: 8px 4px;
    }
    
    .imposition-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .imposition-actions .btn-sm {
        width: 100%;
        justify-content: center;
    }
}