* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f6fa;
    min-height: 100vh;
}

/* Header & Navigation */
.header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header h1 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
}

.hamburger-menu {
    position: relative;
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn:hover span {
    background: #3498db;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1001;
    overflow: hidden;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    color: #2c3e50;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    font-size: 0.95rem;
    text-align: left;
}

.dropdown-item:hover {
    background: #f5f6fa;
}

.dropdown-item .icon {
    font-size: 1.1rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.2);
}

.tab-btn.active {
    background: #f5f6fa;
    color: #2c3e50;
}

.tab-btn .badge {
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 5px;
    transition: background-color 0.3s ease;
}

.tab-btn .badge.badge-zero {
    background: #27ae60;
}

.tab-btn .badge.badge-nonzero {
    background: #e74c3c;
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Request Creation Cards */
.creation-cards {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.creation-card {
    background: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    width: 300px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid transparent;
}

.creation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.creation-card.update-card {
    border-color: #2ecc71;
}

.creation-card.update-card:hover {
    background: #eafaf1;
}

.creation-card.update-card .icon {
    color: #2ecc71;
}

.creation-card.job-card {
    border-color: #3498db;
}

.creation-card.job-card:hover {
    background: #ebf5fb;
}

.creation-card.quote-card {
    border-color: #9b59b6;
}

.creation-card.quote-card:hover {
    background: #f5eef8;
}

.creation-card.transfer-card {
    border-color: #16a085;
}

.creation-card.transfer-card:hover {
    background: #e8f6f3;
}

.creation-card.transfer-card .icon {
    color: #16a085;
}

.creation-card.order-card {
    border-color: #e67e22;
}

.creation-card.order-card:hover {
    background: #fef5e7;
}

.creation-card.order-card .icon {
    color: #e67e22;
}

.creation-card .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.creation-card.job-card .icon {
    color: #3498db;
}

.creation-card.quote-card .icon {
    color: #9b59b6;
}

.creation-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.creation-card p {
    color: #7f8c8d;
}

/* Form Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-body {
    padding: 1.5rem;
}

.progress-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.progress-step {
    flex: 1;
    height: 4px;
    background: #ecf0f1;
    border-radius: 2px;
}

.progress-step.active {
    background: #3498db;
}

.progress-step.completed {
    background: #27ae60;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    min-height: 280px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Override form-group label's display:block when using checkbox-group */
.form-group .checkbox-group,
.form-group label.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-option:hover {
    border-color: #3498db;
}

.radio-option input {
    width: 18px;
    height: 18px;
}

/* Validation error highlighting */
.form-group.validation-error input,
.form-group.validation-error select,
.form-group.validation-error textarea {
    border-color: #e74c3c;
    background: #fdf0ef;
}

.form-group.validation-error label {
    color: #e74c3c;
}

.form-group.validation-error .radio-group .radio-option {
    border-color: #e74c3c;
}

.validation-error-msg {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.4s ease;
}

.form-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-secondary:hover {
    background: #d5dbdb;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

/* Submission Cards */
.submissions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submission-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    border-left: 5px solid;
}

.submission-card.existing-job {
    border-left-color: #3498db;
}

.submission-card.new-job {
    border-left-color: #3498db;
}

.submission-card.quote-only {
    border-left-color: #9b59b6;
}

.card-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
}

.card-header:hover {
    background: #f8f9fa;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.card-title h3 {
    color: #2c3e50;
    font-size: 1.1rem;
}

.card-title-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.card-subtitle {
    font-size: 0.8rem;
    color: #636e72;
    font-weight: 400;
}

.ju-id {
    font-size: 0.7rem;
    color: #95a5a6;
    font-weight: 500;
}

.card-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-existing {
    background: #ebf5fb;
    color: #3498db;
}

.badge-new {
    background: #ebf5fb;
    color: #3498db;
}

.badge-quote {
    background: #f5eef8;
    color: #9b59b6;
}

.badge-emergency {
    background: #fdedec;
    color: #e74c3c;
}

.badge-transfer {
    background: #e8f6f3;
    color: #16a085;
}

.badge-update {
    background: #eafaf1;
    color: #2ecc71;
}

.submission-card.part-transfer {
    border-left-color: #16a085;
}

.submission-card.job-update {
    border-left-color: #2ecc71;
}

.submission-card.grouped-update {
    border-left-color: #3498db;
    border-left-width: 5px;
}

.badge-grouped {
    background: #ebf5fb;
    color: #3498db;
}

/* Update Timeline Styles */
.update-timeline {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.update-timeline h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: #34495e;
}

.update-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
}

.update-timeline-item.timeline-completed {
    background: #eafaf1;
    border-left: 3px solid #27ae60;
}

.update-timeline-item.timeline-incomplete {
    background: #fef5e7;
    border-left: 3px solid #e67e22;
}

.timeline-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.timeline-completed .timeline-marker {
    background: #27ae60;
    color: white;
}

.timeline-incomplete .timeline-marker {
    background: #e67e22;
    color: white;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.timeline-status {
    font-weight: 600;
    font-size: 0.85rem;
}

.timeline-completed .timeline-status {
    color: #27ae60;
}

.timeline-incomplete .timeline-status {
    color: #e67e22;
}

.timeline-date {
    font-size: 0.75rem;
    color: #7f8c8d;
}

.timeline-detail {
    font-size: 0.85rem;
    color: #34495e;
    margin: 0.25rem 0;
}

.timeline-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.7rem;
    color: #95a5a6;
    margin-top: 0.25rem;
}

.btn-delete-small {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-delete-small:hover {
    background: rgba(231, 76, 60, 0.1);
}

.btn-edit-small {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-edit-small:hover {
    background: rgba(52, 152, 219, 0.1);
}

.timeline-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-shrink: 0;
}

.submission-card.part-order {
    border-left-color: #e67e22;
}

.badge-order {
    background: #fef5e7;
    color: #e67e22;
}

.submission-card.door-programming {
    border-left-color: #4682b4;
}

.badge-doorprog {
    background: #e8f0f8;
    color: #4682b4;
}

.creation-card.doorprog-card {
    border-color: #4682b4;
}

.creation-card.doorprog-card:hover {
    background: #e8f0f8;
}

.creation-card.doorprog-card .icon {
    color: #4682b4;
}

.category-header.door-programming .category-count {
    background: #4682b4;
}

.door-entry-row {
    border: 1px solid #dee2e6;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    background: #fafbfc;
}

.door-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.door-entry-row .form-row {
    display: flex;
    gap: 0.75rem;
}

.door-entry-row .form-row .form-group {
    flex: 1;
}

.door-entry-row .radio-group {
    display: flex;
    gap: 1rem;
}

.door-entry-row .checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Month Group Sections (wraps category sections in completed tab) */
.month-section {
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    cursor: pointer;
    transition: background 0.3s;
    user-select: none;
}

.month-header:hover {
    background: linear-gradient(135deg, #34495e, #3d566e);
}

.month-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.05rem;
}

.month-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.month-toggle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.3s;
}

.month-section.collapsed .month-toggle {
    transform: rotate(-90deg);
}

.month-content {
    padding: 0.75rem;
    background: #fafbfc;
}

.month-section.collapsed .month-content {
    display: none;
}

/* Technician filter dropdown */
#completed-tech-filter,
#jobupdates-tech-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#completed-tech-select,
#jobupdates-tech-select {
    padding: 0.4rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #2c3e50;
    background: white;
    cursor: pointer;
    min-width: 140px;
}

#completed-tech-select:focus,
#jobupdates-tech-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Collapsible Category Sections */
.category-section {
    margin-bottom: 1rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 0.5rem;
}

.category-header:hover {
    background: #e9ecef;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
}

.category-count {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.category-header.job-requests .category-count { background: #3498db; }
.category-header.quote-requests .category-count { background: #9b59b6; }
.category-header.part-transfers .category-count { background: #16a085; }
.category-header.part-orders .category-count { background: #e67e22; }
.category-header.door-programming .category-count { background: #2c3e50; }
.category-header.job-updates .category-count { background: #27ae60; }

.category-toggle {
    font-size: 1.2rem;
    color: #7f8c8d;
    transition: transform 0.3s;
}

.category-section.collapsed .category-toggle {
    transform: rotate(-90deg);
}

.category-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 0.5rem;
}

.category-section.collapsed .category-content {
    display: none;
}

.expand-collapse-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.expand-collapse-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    color: #555;
    transition: all 0.2s;
}

.expand-collapse-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.expand-icon {
    font-size: 1.5rem;
    color: #7f8c8d;
    transition: transform 0.3s;
}

.submission-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.card-body {
    display: none;
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid #eee;
}

.submission-card.expanded .card-body {
    display: block;
}

.detail-list {
    list-style: none;
    margin: 1rem 0;
}

.detail-list li {
    padding: 0.5rem 0;
    display: flex;
    border-bottom: 1px solid #f5f5f5;
}

.detail-list li:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #7f8c8d;
    min-width: 150px;
}

.detail-value {
    color: #2c3e50;
    white-space: pre-wrap;
    flex: 1;
    min-width: 0;
}

.nested-quote {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 3px solid #9b59b6;
}

.nested-quote h4 {
    color: #9b59b6;
    margin-bottom: 0.5rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-complete {
    background: #27ae60;
    color: white;
}

.btn-complete:hover {
    background: #219a52;
}

.btn-incomplete {
    background: #e67e22;
    color: white;
}

.btn-incomplete:hover {
    background: #d35400;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-restore {
    background: #3498db;
    color: white;
}

.btn-restore:hover {
    background: #2980b9;
}

/* Drafts Page */
.drafts-page {
    display: none;
}

.drafts-page.active {
    display: block;
}

.drafts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.drafts-header h2 {
    color: #2c3e50;
}

.draft-card {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #9b59b6;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.draft-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.draft-card.job-draft {
    border-left-color: #e67e22;
}

.draft-card.quote-draft {
    border-left-color: #9b59b6;
}

.draft-card.transfer-draft {
    border-left-color: #3498db;
}

.draft-card.partorder-draft {
    border-left-color: #27ae60;
}

.draft-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.draft-card-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.draft-card-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.draft-card-badge.badge-job {
    background: #fef5e7;
    color: #e67e22;
}

.draft-card-badge.badge-quote {
    background: #f5eef8;
    color: #9b59b6;
}

.draft-card-badge.badge-transfer {
    background: #ebf5fb;
    color: #3498db;
}

.draft-card-badge.badge-partorder {
    background: #eafaf1;
    color: #27ae60;
}

.draft-card-preview {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.draft-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #95a5a6;
}

.draft-card-actions {
    display: flex;
    gap: 0.5rem;
}

.draft-card-actions button {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.draft-restore-btn {
    background: #3498db;
    color: white;
}

.draft-restore-btn:hover {
    background: #2980b9;
}

.draft-delete-btn {
    background: #ecf0f1;
    color: #e74c3c;
}

.draft-delete-btn:hover {
    background: #e74c3c;
    color: white;
}

.draft-indicator {
    position: absolute;
    top: 0.5rem;
    right: 3rem;
    background: #9b59b6;
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: none;
}

.draft-indicator.visible {
    display: block;
}

/* Deleted Page */
.deleted-page {
    display: none;
}

.deleted-page.active {
    display: block;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #ecf0f1;
    color: #2c3e50;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #d5dbdb;
}

.deleted-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.deleted-header h2 {
    color: #2c3e50;
}

.submission-card.deleted {
    opacity: 0.8;
    border-left-color: #95a5a6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #7f8c8d;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Legend */
.legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.blue { background: #3498db; }
.legend-color.orange { background: #e67e22; }
.legend-color.purple { background: #9b59b6; }
.legend-color.teal { background: #16a085; }
.legend-color.green { background: #2ecc71; }

/* Job Update specific styles */
.job-info-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2ecc71;
}

.job-info-box h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.job-info-box p {
    color: #7f8c8d;
    margin: 0.25rem 0;
}

.thank-you-message {
    text-align: center;
    padding: 2rem;
}

.thank-you-message .icon {
    font-size: 4rem;
    color: #2ecc71;
    margin-bottom: 1rem;
}

.thank-you-message h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.completion-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-completed {
    background: #2ecc71;
    color: white;
}

.btn-completed:hover {
    background: #27ae60;
}

.btn-not-completed {
    background: #e67e22;
    color: white;
}

.btn-not-completed:hover {
    background: #d35400;
}

.csv-load-section {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.csv-load-section p {
    margin-bottom: 0.5rem;
    color: #856404;
}

/* Job search results list */
.job-search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    margin-top: 0.5rem;
    background: #fff;
}

.job-search-loading {
    padding: 1rem;
    text-align: center;
    color: #7f8c8d;
}

.job-search-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: background 0.2s;
}

.job-search-item:last-child {
    border-bottom: none;
}

.job-search-item:hover {
    background: #eafaf1;
}

.job-search-item .job-number {
    font-weight: bold;
    color: #2c3e50;
    margin-right: 0.5rem;
}

.job-search-item .job-type {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.job-search-item .job-type.type-a { background: #e8f6f3; color: #16a085; }
.job-search-item .job-type.type-d { background: #ebf5fb; color: #3498db; }
.job-search-item .job-type.type-s { background: #f5eef8; color: #9b59b6; }

.job-search-item .job-desc {
    display: block;
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-search-item .job-tech {
    font-size: 0.8rem;
    color: #95a5a6;
}

.job-search-empty {
    padding: 1rem;
    text-align: center;
    color: #e74c3c;
}

.job-search-count {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    color: #7f8c8d;
    font-size: 0.85rem;
    border-bottom: 1px solid #ecf0f1;
}

/* Inline job number assignment (expanded card -> "Assigned Job #").
   The containing <li> is a flex row (label | value). We make
   .detail-value flex:1 above so it fills remaining space; this div
   then naturally spans the full value column as a block child. */
.inline-job-assign {
    display: block;
    width: 100%;
}

.inline-job-display {
    display: inline-block;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.inline-job-display:hover {
    background: #eafaf1;
}

.inline-job-edit {
    margin-top: 0.25rem;
}

.inline-job-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    border: 1px solid #3498db;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

/* Reuse the modal dropdown look (.job-search-results already supplies
   border/background/rounding) — just cap height and float above
   following content with z-index. */
.inline-job-results {
    max-height: 260px;
    position: relative;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

/* Force the modal's compact row layout regardless of ancestor context
   (card body's flex/text-align keeps pushing these around). !important
   here because this block is inside a deeply-styled card, and we want
   to win every specificity fight without tuning selectors per-site. */
.inline-job-results .job-search-item {
    display: block !important;
    text-align: left !important;
    padding: 0.4rem 0.75rem !important;
    line-height: 1.3 !important;
    border-bottom: 1px solid #ecf0f1;
    box-sizing: border-box;
}
.inline-job-results .job-search-item .job-number,
.inline-job-results .job-search-item .job-type,
.inline-job-results .job-search-item .job-tech {
    display: inline-block !important;
    vertical-align: middle !important;
    float: none !important;
    width: auto !important;
    margin: 0 0.4rem 0 0 !important;
}
.inline-job-results .job-search-item .job-number {
    font-weight: 700;
    color: #2c3e50;
}
.inline-job-results .job-search-item .job-type {
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.72rem;
}
.inline-job-results .job-search-item .job-tech {
    font-size: 0.78rem;
    color: #95a5a6;
}
.inline-job-results .job-search-item .job-desc {
    display: block !important;
    width: 100% !important;
    margin: 0.1rem 0 0 0 !important;
    color: #7f8c8d;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inline-job-results .job-search-count {
    text-align: left !important;
    padding: 0.3rem 0.75rem !important;
    font-size: 0.78rem !important;
}

/* Photo upload styling */
.photo-upload-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.photo-upload-btn {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    border: 2px dashed #ecf0f1;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.photo-upload-btn:hover {
    border-color: #16a085;
    background: #e8f6f3;
}

.photo-upload-btn .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.photo-preview {
    margin-top: 1rem;
    display: none;
}

.photo-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #ecf0f1;
}

.photo-preview.has-photo {
    display: block;
}

/* Multi-photo preview gallery */
.multi-photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.multi-photo-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ecf0f1;
}

.multi-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.multi-photo-item .remove-photo {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-photo-item .remove-photo:hover {
    background: #c0392b;
}

.photo-count {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* PDF preview styling in multi-photo gallery */
.multi-photo-item.pdf-item {
    background: #f8f9fa;
    border-color: #e74c3c;
}

.multi-photo-item .pdf-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 4px;
    box-sizing: border-box;
}

.multi-photo-item .pdf-icon {
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: 4px;
}

.multi-photo-item .pdf-name {
    font-size: 0.6rem;
    color: #666;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .creation-cards {
        flex-direction: column;
        align-items: center;
    }

    .creation-card {
        width: 100%;
        max-width: 300px;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        text-align: center;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .detail-list li {
        flex-direction: column;
    }

    .detail-label {
        min-width: auto;
        margin-bottom: 0.25rem;
    }

    /* In column layout, flex:1 grows vertically — we need explicit
       horizontal fill for the value span (which hosts inputs/dropdowns). */
    .detail-value {
        width: 100%;
    }
}

/* Login Screen Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-overlay.hidden {
    display: none;
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-header h1 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #3498db;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1a5276);
    transform: translateY(-1px);
}

.login-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    background: #fdedec;
    color: #e74c3c;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    display: none;
}

.login-error.show {
    display: block;
}

/* User info in header */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.user-name {
    font-size: 0.9rem;
    opacity: 0.9;
}

.user-name strong {
    opacity: 1;
}

.signout-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.signout-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Image Enlargement Modal */
.image-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.image-modal-overlay.active {
    display: flex;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: -10px;
    background: #e74c3c;
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.image-modal-close:hover {
    background: #c0392b;
    transform: scale(1.1);
}

#image-modal-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.image-modal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
    z-index: 2001;
}

.image-modal-arrow:hover {
    background: rgba(255, 255, 255, 0.35);
}

.image-modal-prev {
    left: 1rem;
}

.image-modal-next {
    right: 1rem;
}

.image-modal-counter {
    text-align: center;
    color: white;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    opacity: 0.8;
}

/* Clickable thumbnails in submission cards */
.clickable-thumbnail {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile adjustments for image modal */
@media (max-width: 768px) {
    .image-modal-overlay {
        padding: 1rem;
    }

    .image-modal-close {
        top: -35px;
        right: 0;
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }

    #image-modal-img {
        max-width: 100%;
        max-height: 80vh;
    }

    .image-modal-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .image-modal-prev {
        left: 0.5rem;
    }

    .image-modal-next {
        right: 0.5rem;
    }
}

/* Edit Button Styles */
.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
}

/* Edit Modal Styles */
.edit-modal {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-modal .modal-body {
    padding: 1.5rem;
}

.edit-modal .form-group {
    margin-bottom: 1.25rem;
}

.edit-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.edit-modal .form-group input,
.edit-modal .form-group textarea,
.edit-modal .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.edit-modal .form-group input:focus,
.edit-modal .form-group textarea:focus,
.edit-modal .form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.edit-modal .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.edit-modal .checkbox-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.edit-modal .checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.edit-modal .checkbox-option input[type="checkbox"] {
    width: auto;
}

/* Fix checkbox-group alignment in edit modal */
.edit-modal .form-group label.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.edit-modal .form-group label.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Edit Photos Grid */
.edit-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.edit-photo-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
}

.edit-photo-thumbnail {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

.btn-delete-photo {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-delete-photo:hover {
    background: #c0392b;
}

/* Videos (edit modal + cards) */
.edit-videos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.edit-video-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
}

.edit-video-thumbnail {
    width: 240px;
    max-height: 160px;
    border-radius: 4px;
    background: #000;
}

.video-upload-status {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #ecf0f1;
    font-size: 0.9rem;
}

.video-progress-label { margin-bottom: 0.4rem; color: #2c3e50; }
.video-progress-bar {
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}
.video-progress-fill {
    height: 100%;
    background: #3498db;
    transition: width 150ms ease-out;
}
.video-progress-pct {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-align: right;
    font-family: "Courier New", monospace;
}

/* Job card: video thumbnail with play overlay */
.job-video-thumb {
    position: relative;
    display: inline-block;
    margin: 0.25rem;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    vertical-align: top;
}
.job-video-thumb video {
    display: block;
    max-width: 180px;
    max-height: 120px;
}
.job-video-thumb .play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    background: rgba(0,0,0,0.25);
    pointer-events: none;
    transition: background 150ms;
}
.job-video-thumb:hover .play-badge { background: rgba(0,0,0,0.1); }

/* Video playback modal */
.video-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2100;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
.video-modal-overlay.active { display: flex; }
.video-modal-overlay video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 6px;
    background: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.video-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #e74c3c;
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 2101;
}
.video-modal-close:hover { background: #c0392b; transform: scale(1.1); }

/* Quote PDF viewer modal (Job Intel "View PDF", gated by quote_pdf_access) */
.pdf-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2100;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.pdf-modal-overlay.active { display: flex; }
.pdf-modal-box {
    width: min(1000px, 100%);
    height: 94vh;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.pdf-modal-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.9rem;
    background: #2c3e50;
    color: #fff;
}
.pdf-modal-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-modal-actions { display: flex; align-items: center; gap: 0.9rem; flex-shrink: 0; }
.pdf-modal-link {
    color: #fff;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
}
.pdf-modal-link.is-disabled { opacity: 0.4; pointer-events: none; }
.pdf-modal-close {
    background: #e74c3c;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}
.pdf-modal-close:hover { background: #c0392b; transform: scale(1.1); }
.pdf-modal-status {
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    color: #555;
    background: #fdf6ec;
    border-bottom: 1px solid #f0d9b5;
}
.pdf-modal-frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: #525659;
}
@media (max-width: 600px) {
    .pdf-modal-overlay { padding: 0; }
    .pdf-modal-box { height: 100vh; border-radius: 0; }
    .pdf-modal-link { font-size: 0.8rem; }
}

/* "View PDF" button on Job Intel quote cards */
.jobiq-quote-pdf-btn {
    background: #fff;
    border: 1px solid #e67e22;
    color: #e67e22;
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.jobiq-quote-pdf-btn:hover { background: #e67e22; color: #fff; }

/* Card actions with edit button */
.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-actions .btn {
    flex: 1;
    min-width: 100px;
}

/* Tab Header Controls - Filter and Legend */
.tab-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tab-header-controls .legend {
    margin-bottom: 0;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #7f8c8d;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.filter-btn.active {
    background: #3498db;
    color: white;
}

/* Mobile responsive for filter controls */
@media (max-width: 768px) {
    .tab-header-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-controls {
        justify-content: center;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Part Order Parts Input */
#partorder-parts-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.part-input-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.part-qty-label {
    width: 55px;
    text-align: center;
    font-size: 0.85rem;
    color: #7f8c8d;
    font-weight: 500;
}

.part-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.part-input-row .part-info-input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.part-input-row .part-qty-input,
.link-input-row .part-qty-input {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    text-align: center;
    flex-shrink: 0;
    padding: 0.75rem 0.25rem;
}

.btn-delete-part {
    width: 32px;
    height: 32px;
    padding: 0;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-delete-part:hover {
    background: #c0392b;
}

.btn-add-part {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

.btn-add-part:hover {
    border-color: #e67e22;
    color: #e67e22;
    background: #fef5e7;
}

/* Part Order Links Input */
#partorder-links-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.link-input-row .part-link-input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.btn-delete-link {
    width: 32px;
    height: 32px;
    padding: 0;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-delete-link:hover {
    background: #c0392b;
}

.btn-add-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

.btn-add-link:hover {
    border-color: #3498db;
    color: #3498db;
    background: #ebf5fb;
}

/* Part Links Display in Cards */
.part-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.part-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
    padding: 0.25rem 0.5rem;
    background: #ebf5fb;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.part-link:hover {
    background: #d4e6f1;
    text-decoration: underline;
}

.part-link::before {
    content: "🔗 ";
}

/* Acknowledge Button Styles */
.btn-acknowledge {
    background: #9b59b6;
    color: white;
}

.btn-acknowledge:hover {
    background: #8e44ad;
}

.btn-ack-small {
    background: none;
    border: none;
    color: #9b59b6;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-ack-small:hover {
    background: rgba(155, 89, 182, 0.1);
}

.btn-download-small {
    background: #27ae60;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    transition: background 0.2s;
    margin-left: 0.5rem;
}

.btn-download-small:hover {
    background: #219a52;
}

/* PDF download button in photos section */
.btn-download-pdf {
    background: #e74c3c;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: background 0.2s;
    margin: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-download-pdf:hover {
    background: #c0392b;
}

.btn-download-pdf .pdf-icon {
    font-size: 1.1rem;
}

/* Acknowledged timeline status */
.timeline-acknowledged {
    display: block;
    font-size: 0.7rem;
    color: #9b59b6;
    margin-top: 0.25rem;
    font-style: italic;
}

.timeline-ack-note {
    margin-top: 0.25rem;
}

/* ===== ACKNOWLEDGE NOTE DROPDOWN ===== */
.ack-note-form {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8f4fb;
    border: 1px solid #d9c6e8;
    border-radius: 6px;
    animation: ackNoteDrop 0.15s ease-out;
}

@keyframes ackNoteDrop {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ack-note-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem;
    border: 1px solid #d5dbdb;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.ack-note-input::placeholder {
    color: #95a5a6;
}

.ack-note-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-cancel-ack {
    background: #ecf0f1;
    color: #555;
}

.btn-cancel-ack:hover {
    background: #d5dbdb;
}

/* ===== TRANSFER MULTI-PART STYLES ===== */

/* Collapsible Part Cards */
.transfer-part-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: border-color 0.3s;
}

.transfer-part-card:hover {
    border-color: #16a085;
}

.transfer-part-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f0faf8;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.transfer-part-card-header:hover {
    background: #e0f5f0;
}

.transfer-part-card-header .part-title {
    font-weight: 600;
    color: #16a085;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transfer-part-card-header .part-title .part-summary {
    font-weight: 400;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.transfer-part-card-header .card-toggle {
    font-size: 1rem;
    color: #7f8c8d;
    transition: transform 0.3s;
}

.transfer-part-card.collapsed .card-toggle {
    transform: rotate(-90deg);
}

.transfer-part-card-body {
    padding: 1rem;
    border-top: 1px solid #ecf0f1;
}

.transfer-part-card.collapsed .transfer-part-card-body {
    display: none;
}

.transfer-part-card-body .form-group {
    margin-bottom: 1rem;
}

.transfer-part-card-body .form-group:last-child {
    margin-bottom: 0;
}

/* Add/Remove Part Buttons */
.btn-add-transfer-part {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

.btn-add-transfer-part:hover {
    border-color: #16a085;
    color: #16a085;
    background: #e8f6f3;
}

.btn-remove-transfer-part {
    width: 28px;
    height: 28px;
    padding: 0;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.btn-remove-transfer-part:hover {
    background: #c0392b;
}

/* Part Selection Checkbox List (Step 2 & 4) */
.transfer-part-checkbox-list {
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.transfer-part-checkbox-list .select-all-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f0faf8;
    border-bottom: 2px solid #16a085;
    cursor: pointer;
    font-weight: 600;
    color: #16a085;
    transition: background 0.2s;
}

.transfer-part-checkbox-list .select-all-row:hover {
    background: #e0f5f0;
}

.transfer-part-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

.transfer-part-checkbox-item:last-child {
    border-bottom: none;
}

.transfer-part-checkbox-item:hover {
    background: #f8f9fa;
}

.transfer-part-checkbox-item input[type="checkbox"],
.transfer-part-checkbox-list .select-all-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #16a085;
    flex-shrink: 0;
}

.transfer-part-checkbox-item .part-checkbox-label {
    flex: 1;
}

.transfer-part-checkbox-item .part-checkbox-label .part-num {
    font-weight: 600;
    color: #2c3e50;
}

.transfer-part-checkbox-item .part-checkbox-label .part-desc {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* Parts Info Box (Step 4) */
.transfer-to-parts-info {
    background: #e8f6f3;
    border: 1px solid #16a085;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.transfer-to-parts-info .info-title {
    font-weight: 600;
    color: #16a085;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.transfer-to-parts-info .info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.transfer-to-parts-info .info-list li {
    padding: 0.25rem 0;
    color: #2c3e50;
    font-size: 0.9rem;
}

.transfer-to-parts-info .info-list li::before {
    content: "\2022";
    color: #16a085;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Review Summary Table (Step 6) */
.transfer-review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.transfer-review-table th {
    background: #16a085;
    color: white;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transfer-review-table th:first-child {
    border-radius: 8px 0 0 0;
}

.transfer-review-table th:last-child {
    border-radius: 0 8px 0 0;
}

.transfer-review-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #ecf0f1;
    color: #2c3e50;
    vertical-align: top;
}

.transfer-review-table tr:last-child td {
    border-bottom: none;
}

.transfer-review-table tr:nth-child(even) {
    background: #f8f9fa;
}

.transfer-review-table .part-num-cell {
    font-weight: 600;
}

.transfer-review-table .location-cell {
    font-size: 0.85rem;
}

/* Edit Links container for part orders */
#edit-partorder-links-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
}

/* ============================================================================
   PO SEARCH TAB
   ============================================================================ */

.po-search-container {
    max-width: 100%;
}

.po-search-header {
    margin-bottom: 1rem;
}

.po-search-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.po-stats-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.po-stat {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.po-stat strong {
    color: #2c3e50;
}

.po-stat.invoiced strong { color: #27ae60; }
.po-stat.procured strong { color: #3498db; }
.po-stat.pending strong { color: #e67e22; }
.po-stat.vendors strong { color: #9b59b6; }

.po-search-bar {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 0.5rem;
}

.po-search-bar input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.po-search-bar input[type="text"]:focus {
    border-color: #3498db;
}

.po-filter-row {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.po-filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.po-filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}

.po-filter-group select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    max-width: 180px;
}

.po-results-count {
    padding: 0.5rem 0;
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* PO Table */
.po-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.po-table-header {
    display: grid;
    grid-template-columns: 80px 150px 1fr 90px 100px 80px 30px 30px;
    padding: 0.6rem 1rem;
    background: #2c3e50;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 0.5rem;
}

.po-row {
    display: grid;
    grid-template-columns: 80px 150px 1fr 90px 100px 80px 30px 30px;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    cursor: default;
    transition: background 0.15s;
    gap: 0.5rem;
    align-items: center;
}

.po-row:hover {
    background: #f8f9fa;
}

.po-row:last-child {
    border-bottom: none;
}

.po-row-pending {
    background: #fef9e7;
}

.po-row-pending:hover {
    background: #fdf3cd;
}

.po-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.po-col-num strong {
    color: #2c3e50;
}

.po-col-vendor {
    color: #8e44ad;
}

.po-col-part {
    color: #555;
}

.po-col-job {
    color: #2980b9;
    font-weight: 500;
}

.po-col-date {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.po-col-tech {
    color: #16a085;
}

.po-col-flags {
    text-align: center;
    font-weight: bold;
}

.po-sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.po-sortable:hover {
    background: rgba(255,255,255,0.15);
}

.po-sorted {
    background: rgba(255,255,255,0.1);
}

.flag-yes {
    color: #27ae60;
}

.flag-no {
    color: #ddd;
}

/* Mobile responsive for PO table */
@media (max-width: 768px) {
    .po-table-header {
        display: none;
    }

    .po-row {
        display: flex;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.25rem 1rem;
    }

    .po-col {
        white-space: normal;
    }

    .po-col-num {
        font-size: 0.9rem;
        width: auto;
    }

    .po-col-vendor {
        width: auto;
    }

    .po-col-part {
        width: 100%;
        font-size: 0.8rem;
    }

    .po-col-job,
    .po-col-date,
    .po-col-tech {
        font-size: 0.8rem;
    }

    .po-filter-row {
        flex-direction: column;
    }

    .po-filter-group select {
        max-width: 100%;
        flex: 1;
    }
}

/* ============================================================================
   TO SCHEDULE TAB
   ============================================================================ */

.sched-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.sched-header {
    margin-bottom: 1rem;
}

.sched-header h2 {
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.sched-subtitle {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.sched-search-bar {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 0.75rem;
}

.sched-search-bar input[type="text"] {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.sched-search-bar input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}

.sched-filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.sched-filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sched-filter-group label {
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
}

.sched-filter-group select {
    padding: 0.35rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    max-width: 160px;
}

.sched-results-count {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: #555;
    flex-wrap: wrap;
}

.sched-stat {
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.sched-stat.ready {
    background: #d5f5e3;
    color: #1e8449;
}

.sched-stat.partial {
    background: #fdebd0;
    color: #b7950b;
}

.sched-stat.none {
    background: #eaecee;
    color: #7f8c8d;
}

/* Schedule Table */
.sched-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sched-table-header {
    display: grid;
    grid-template-columns: 90px 70px 1fr 100px 110px 90px;
    background: #2c3e50;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sched-row {
    display: grid;
    grid-template-columns: 90px 70px 1fr 100px 110px 90px;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
    align-items: center;
}

.sched-row:hover {
    background: #f8f9fa;
}

.sched-row-ready {
    background: #f0faf4;
}

.sched-row-ready:hover {
    background: #e0f5ea;
}

.sched-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 0.5rem;
}

.sched-sortable {
    cursor: pointer;
    user-select: none;
}

.sched-sortable:hover {
    background: rgba(255,255,255,0.15);
}

.sched-sorted {
    background: rgba(255,255,255,0.1);
}

/* Type badges */
.sched-type {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sched-type-D {
    background: #d4efdf;
    color: #1e8449;
}

.sched-type-A {
    background: #d6eaf8;
    color: #2471a3;
}

.sched-type-S {
    background: #f5eef8;
    color: #7d3c98;
}

/* Parts status badges */
.sched-parts-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sched-parts-badge.ready {
    background: #27ae60;
    color: white;
}

.sched-parts-badge.partial {
    background: #f39c12;
    color: white;
}

.sched-parts-badge.none {
    background: #eaecee;
    color: #95a5a6;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sched-table-header {
        display: none;
    }

    .sched-row {
        display: flex;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.25rem 1rem;
    }

    .sched-col {
        white-space: normal;
    }

    .sched-col-job {
        width: auto;
        font-size: 0.9rem;
    }

    .sched-col-type {
        width: auto;
    }

    .sched-col-desc {
        width: 100%;
        font-size: 0.8rem;
    }

    .sched-col-tech,
    .sched-col-ordered {
        font-size: 0.8rem;
    }

    .sched-filter-row {
        flex-direction: column;
    }

    .sched-filter-group select {
        max-width: 100%;
        flex: 1;
    }
}

/* ============================================================================
   JOB IQ TAB — 5-column card grid with expandable overlay
   ============================================================================ */

.jobiq-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.jobiq-header {
    margin-bottom: 1rem;
}

.jobiq-header h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 0.8rem;
}

.jobiq-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.4rem;
}

.jobiq-toolbar input {
    flex: 1;
    padding: 0.55rem 0.9rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.jobiq-toolbar input:focus {
    outline: none;
    border-color: #3498db;
}

.jobiq-toolbar select {
    padding: 0.55rem 0.7rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.jobiq-toolbar select:focus {
    outline: none;
    border-color: #3498db;
}

.jobiq-sort-btn {
    padding: 0.55rem 1rem;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.jobiq-sort-btn:hover { background: #34495e; }

.jobiq-results-count {
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* ---------- 3-column board layout (Door | Auto | Security) ---------- */
.jobiq-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: start;
}

.jobiq-column {
    background: #f0f2f5;
    border-radius: 12px;
    padding: 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.jobiq-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.jobiq-col-door-header     { background: #3498db; color: white; }
.jobiq-col-auto-header     { background: #e67e22; color: white; }
.jobiq-col-security-header { background: #27ae60; color: white; }

.jobiq-col-title {
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jobiq-col-count {
    background: rgba(255,255,255,0.3);
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
}

.jobiq-col-cards {
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

.jobiq-col-empty {
    text-align: center;
    color: #95a5a6;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

.jobiq-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.8rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    min-height: 110px;
    position: relative;
}

.jobiq-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Type colour accents */
.jobiq-type-door   { border-left: 4px solid #3498db; }
.jobiq-type-auto   { border-left: 4px solid #e67e22; }
.jobiq-type-security { border-left: 4px solid #27ae60; }

.jobiq-card-number {
    font-weight: 700;
    font-size: 0.95rem;
    color: #2c3e50;
}

.jobiq-card-desc {
    font-size: 0.8rem;
    color: #555;
    flex: 0 0 auto;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.jobiq-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #95a5a6;
    border-top: 1px solid #f0f0f0;
    padding-top: 0.3rem;
    margin-top: auto;
}

.jobiq-card-type { font-weight: 600; text-transform: uppercase; }
.jobiq-card-date { color: #aab; font-size: 0.7rem; }
.jobiq-card-tech { text-align: right; }

/* ---------- Latest update tag on card ---------- */
.jobiq-card-update {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    background: #ecf0f1;
    color: #555;
    margin-top: 0.1rem;
}

.jobiq-update-label {
    font-weight: 700;
    text-transform: capitalize;
}

.jobiq-update-count {
    background: rgba(0,0,0,0.15);
    padding: 0 0.35rem;
    border-radius: 8px;
    font-size: 0.65rem;
    margin-left: 0.25rem;
}

.jobiq-update-date {
    font-size: 0.65rem;
    color: #888;
    white-space: nowrap;
}

/* Update type colors */
.jobiq-update-completed, .jobiq-update-complete { background: #d5f5e3; color: #1e7e34; }
.jobiq-update-in_progress     { background: #d6eaf8; color: #2471a3; }
.jobiq-update-need_parts      { background: #fdebd0; color: #b9770e; }
.jobiq-update-waiting         { background: #fef9e7; color: #b7950b; }
.jobiq-update-on_hold         { background: #f5eef8; color: #7d3c98; }
.jobiq-update-scheduled       { background: #e8f8f5; color: #148f77; }
/* 'incomplete' is the DEFAULT Add Update selection and 'not_complete' is a
   legacy DB value — both rendered unstyled grey before 2026-07-21. */
.jobiq-update-incomplete, .jobiq-update-not_complete { background: #fef5e7; color: #b9770e; }

/* ---------- Updates in detail panel ---------- */
.jobiq-update-entry {
    border-left: 3px solid #bdc3c7;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0 8px 8px 0;
    background: #f9f9f9;
}

.jobiq-update-entry.jobiq-update-completed, .jobiq-update-entry.jobiq-update-complete { border-left-color: #27ae60; background: #f0faf4; }
.jobiq-update-entry.jobiq-update-in_progress { border-left-color: #3498db; background: #f0f7fd; }
.jobiq-update-entry.jobiq-update-need_parts  { border-left-color: #e67e22; background: #fef7f0; }
.jobiq-update-entry.jobiq-update-waiting     { border-left-color: #f1c40f; background: #fefcf0; }
.jobiq-update-entry.jobiq-update-on_hold     { border-left-color: #9b59b6; background: #f9f4fc; }
.jobiq-update-entry.jobiq-update-scheduled   { border-left-color: #1abc9c; background: #f0fcfa; }
.jobiq-update-entry.jobiq-update-incomplete, .jobiq-update-entry.jobiq-update-not_complete { border-left-color: #e67e22; background: #fef7f0; }

.jobiq-update-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.jobiq-update-entry-type {
    font-weight: 700;
    text-transform: capitalize;
    font-size: 0.85rem;
}

.jobiq-update-entry-meta {
    font-size: 0.75rem;
    color: #888;
}

.jobiq-update-delete {
    background: transparent;
    border: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.25rem;
    margin-left: 0.35rem;
    border-radius: 3px;
    opacity: 0.55;
    transition: opacity 0.15s, background 0.15s;
}
.jobiq-update-delete:hover { opacity: 1; background: rgba(192, 57, 43, 0.12); }

.jobiq-update-entry-body {
    font-size: 0.85rem;
    color: #444;
    line-height: 1.4;
}

.jobiq-update-entry-ack {
    font-size: 0.75rem;
    color: #9b59b6;
    font-style: italic;
    margin-top: 0.3rem;
}

.jobiq-update-entry-ack-note {
    font-size: 0.85rem;
    color: #444;
    font-style: normal;
    margin-top: 0.2rem;
}

/* ---------- Inline Add Update Form ---------- */
.jobiq-add-update-form {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px dashed #d5dbdb;
    border-radius: 6px;
    background: #fafafa;
}
.jobiq-add-update-form h4 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: #2c3e50;
    font-weight: 600;
}
.jobiq-add-update-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.jobiq-add-update-fields select {
    padding: 0.4rem 0.5rem;
    border: 1px solid #d5dbdb;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    max-width: 200px;
}
.jobiq-add-update-fields textarea {
    padding: 0.4rem 0.5rem;
    border: 1px solid #d5dbdb;
    border-radius: 4px;
    font-size: 0.85rem;
    resize: vertical;
    font-family: inherit;
    min-height: 60px;
}
.jobiq-add-update-fields textarea:focus,
.jobiq-add-update-fields select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}
.jobiq-add-update-actions {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.jobiq-add-update-actions button {
    padding: 0.4rem 1rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.jobiq-add-update-actions button:hover { background: #2980b9; }
.jobiq-add-update-actions button:disabled { background: #95a5a6; cursor: not-allowed; }
#jobiq-inline-update-msg { font-size: 0.8rem; }
.jobiq-inline-success { color: #27ae60; font-weight: 600; }
.jobiq-inline-error { color: #e74c3c; font-weight: 600; }

.jobiq-card-indicators {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.jobiq-ind {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 8px;
    line-height: 1;
}

.jobiq-ind-quote { background: #fef0db; color: #c77d1a; }
.jobiq-ind-po    { background: #dff5f0; color: #1a7a6a; }

/* ---------- Expanded detail overlay ---------- */
.jobiq-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
    overflow-y: auto;
}

.jobiq-overlay.active {
    display: flex;
}

.jobiq-detail-panel {
    background: white;
    border-radius: 14px;
    width: 100%;
    max-width: 800px;
    padding: 1.5rem 2rem;
    position: relative;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    animation: jobiqSlideUp 0.2s ease-out;
}

@keyframes jobiqSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.jobiq-close-btn {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #95a5a6;
    cursor: pointer;
    line-height: 1;
}

.jobiq-close-btn:hover { color: #e74c3c; }

/* Loading overlay */
.jobiq-load-overlay {
    position: absolute;
    inset: 0;
    background: rgba(245, 246, 250, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.3s;
}

.jobiq-load-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.jobiq-load-spinner {
    text-align: center;
}

.jobiq-load-spinner p {
    margin-top: 0.75rem;
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
}

.jobiq-load-bar {
    width: 200px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.jobiq-load-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: #3498db;
    border-radius: 2px;
    animation: jobiq-loading 1s ease-in-out infinite;
}

@keyframes jobiq-loading {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* Make tab content position relative for overlay */
#jobiq-tab {
    position: relative;
}

/* Detail panel content */
.jobiq-det-header h2 {
    color: #2c3e50;
    margin: 0 0 0.2rem;
}

.jobiq-det-desc {
    color: #555;
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
}

.jobiq-det-section {
    margin-top: 1.2rem;
}

.jobiq-det-section h3 {
    color: #2c3e50;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #eee;
}

.jobiq-det-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem 1.5rem;
}

.jobiq-det-info div {
    display: flex;
    flex-direction: column;
}

.jobiq-label {
    font-size: 0.7rem;
    color: #95a5a6;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 0.1rem;
}

/* Quote cards inside detail */
.jobiq-quote-card {
    background: #fdf6ec;
    border: 1px solid #f0d9b5;
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
}

.jobiq-quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.jobiq-quote-header strong { color: #e67e22; }

.jobiq-quote-meta {
    font-size: 0.8rem;
    color: #888;
}

.jobiq-quote-info {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.3rem;
}

/* Line items table */
.jobiq-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

.jobiq-items-table th {
    background: #f8f0e3;
    text-align: left;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #8a6d3b;
}

.jobiq-items-table td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid #f0e6d6;
}

.jobiq-qty {
    width: 50px;
    text-align: center;
    font-weight: 600;
}

/* PO table inside detail */
.jobiq-po-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.jobiq-po-table th {
    background: #e8f6f3;
    text-align: left;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #1a7a6a;
}

.jobiq-po-table td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid #e0f0ec;
}

.jobiq-empty-note {
    color: #95a5a6;
    font-style: italic;
    font-size: 0.9rem;
}

/* ---------- Responsive ----------
   (Recent-grid rules removed 2026-08-17 — the view moved to the Jobs tab) */
@media (max-width: 900px) {
    .jobiq-board { grid-template-columns: 1fr; }
    .jobiq-col-cards { max-height: none; }
}

@media (max-width: 640px) {
    .jobiq-detail-panel { padding: 1rem; }
    .jobiq-po-table th:nth-child(4),
    .jobiq-po-table td:nth-child(4) { display: none; }
}

/* ============================================================================
   JOBS TAB (jobsdash) — all-jobs dashboard: grid/list + follow-up notes.
   Self-contained .jd-* namespace (no .jobiq-* dependencies except the shared
   .jobiq-load-overlay spinner + .jobiq-sort-btn button skin). 2026-08-17.
   ============================================================================ */

.jd-container { max-width: 1400px; margin: 0 auto; }
.jd-header h2 { color: #2c3e50; margin-bottom: 0.75rem; }

/* Board | All Jobs switcher at the top of the Job Intel tab (2026-08-17) */
.jobiq-viewbar {
    max-width: 1400px; margin: 0 auto 0.9rem;
    display: flex; align-items: center; gap: 0.5rem;
}

.jd-toolbar {
    display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
    margin-bottom: 0.5rem;
}
.jd-toolbar input[type="text"] {
    flex: 1 1 220px; min-width: 180px;
    padding: 0.55rem 0.8rem; border: 1px solid #d5dbe0; border-radius: 8px;
    font-size: 0.9rem;
}
.jd-toolbar select {
    padding: 0.5rem 0.6rem; border: 1px solid #d5dbe0; border-radius: 8px;
    font-size: 0.85rem; background: #fff;
}

.jd-chips { display: inline-flex; border: 1px solid #d5dbe0; border-radius: 8px; overflow: hidden; }
.jd-chip {
    border: none; background: #fff; padding: 0.5rem 0.85rem;
    font-size: 0.85rem; cursor: pointer; color: #2c3e50;
}
.jd-chip + .jd-chip { border-left: 1px solid #d5dbe0; }
.jd-chip.active { background: #3498db; color: #fff; }

/* --- multi-select filter (Tech) — trigger button + checkbox popover --- */
.jd-multi { position: relative; display: inline-block; }
.jd-multi-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.6rem; border: 1px solid #d5dbe0; border-radius: 8px;
    font-size: 0.85rem; background: #fff; color: #2c3e50; cursor: pointer;
    max-width: 190px;
}
.jd-multi-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-multi-btn.active { border-color: #3498db; color: #2471a3; font-weight: 600; }
.jd-multi-caret { font-size: 0.7rem; color: #7f8c8d; }

.jd-multi-menu {
    /* 60 clears .jobiq-load-overlay (50), which is appended LAST inside
       #jd-home and would otherwise paint over the menu on a tie. */
    position: absolute; z-index: 60; top: calc(100% + 4px); left: 0;
    width: 250px; background: #fff;
    border: 1px solid #d5dbe0; border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
}
.jd-multi-menu[hidden] { display: none; }   /* defensive: never let a display rule outrank [hidden] */

.jd-multi-head { display: flex; gap: 0.35rem; padding: 0.5rem; border-bottom: 1px solid #eef1f3; }
.jd-multi-head input {
    flex: 1 1 auto; min-width: 0;
    padding: 0.35rem 0.5rem; border: 1px solid #d5dbe0; border-radius: 6px; font-size: 0.82rem;
}
.jd-multi-clear {
    border: 1px solid #d5dbe0; background: #fff; border-radius: 6px;
    padding: 0.35rem 0.55rem; font-size: 0.78rem; color: #7f8c8d; cursor: pointer;
}
.jd-multi-clear:hover { color: #e74c3c; border-color: #e74c3c; }

.jd-multi-list { max-height: 260px; overflow-y: auto; padding: 0.25rem; }
.jd-multi-opt {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.45rem; border-radius: 6px;
    font-size: 0.85rem; color: #2c3e50; cursor: pointer;
}
.jd-multi-opt:hover { background: #f4f8fb; }
.jd-multi-opt input { margin: 0; cursor: pointer; flex: 0 0 auto; }
.jd-multi-opt-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-multi-opt-count { flex: 0 0 auto; font-size: 0.72rem; color: #95a5a6; }
.jd-multi-empty { padding: 0.6rem 0.5rem; font-size: 0.82rem; color: #95a5a6; text-align: center; }

.jd-results-count { font-size: 0.85rem; color: #7f8c8d; margin-bottom: 0.6rem; }

/* --- grid mode --- */
.jd-cards {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
}
@media (max-width: 1280px) { .jd-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .jd-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .jd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .jd-cards { grid-template-columns: 1fr; } }

.jd-card {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 12px;
    padding: 0.8rem; cursor: pointer;
    display: flex; flex-direction: column; gap: 0.35rem;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    min-height: 110px; position: relative;
}
.jd-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.jd-type-d { border-left: 4px solid #3498db; }
.jd-type-a { border-left: 4px solid #e67e22; }
.jd-type-s { border-left: 4px solid #9b59b6; }

.jd-card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; }
.jd-card-number { font-weight: 700; color: #2c3e50; font-size: 0.9rem; user-select: text; }
.jd-card-desc {
    font-size: 0.8rem; color: #444; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.jd-card-customer { font-size: 0.75rem; color: #2471a3; font-weight: 600; }
.jd-card-footer {
    margin-top: auto; display: flex; justify-content: space-between; gap: 0.4rem;
    font-size: 0.68rem; color: #888;
}
.jd-card-tech { font-weight: 600; }
.jd-card-badges { display: inline-flex; gap: 0.3rem; align-items: center; }

.jd-status {
    font-size: 0.62rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 10px;
    white-space: nowrap;
}
.jd-status-open { background: #d5f5e3; color: #1e7e34; }
.jd-status-done { background: #eceff1; color: #78909c; }

.jd-note-badge {
    font-size: 0.68rem; font-weight: 600; color: #8e44ad;
    background: #f4ecf7; border-radius: 10px; padding: 0.12rem 0.45rem;
    white-space: nowrap;
}

/* --- list mode --- */
.jd-table-wrap {
    overflow: auto; max-height: calc(100vh - 320px);
    border: 1px solid #e0e0e0; border-radius: 10px; background: #fff;
}
.jd-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.jd-table th {
    position: sticky; top: 0; background: #2c3e50; color: #fff;
    text-align: left; padding: 0.55rem 0.7rem; font-size: 0.75rem; white-space: nowrap;
    z-index: 1;
}
.jd-table td { padding: 0.45rem 0.7rem; border-top: 1px solid #f0f2f4; vertical-align: top; }
.jd-table tbody tr { cursor: pointer; }
.jd-table tbody tr:hover { background: #f6f9fc; }
.jd-td-number { font-weight: 700; color: #2c3e50; white-space: nowrap; }
.jd-td-desc { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-type-pill {
    font-size: 0.65rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 8px;
    white-space: nowrap;
}
.jd-type-pill.jd-type-d { background: #eaf4fc; color: #2471a3; border-left: none; }
.jd-type-pill.jd-type-a { background: #fdf0e5; color: #b9770e; border-left: none; }
.jd-type-pill.jd-type-s { background: #f4ecf7; color: #7d3c98; border-left: none; }
.jd-type-pill.jd-type-x { background: #eceff1; color: #78909c; }

.jd-showmore { text-align: center; padding: 0.9rem 0; }
.jd-showmore-btn {
    background: #fff; border: 1px solid #d5dbe0; border-radius: 8px;
    padding: 0.55rem 1.1rem; font-size: 0.85rem; color: #2c3e50; cursor: pointer;
}
.jd-showmore-btn:hover { background: #f6f9fc; }

/* --- detail overlay + note composer + timeline --- */
.jd-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(20, 30, 40, 0.55);
    padding: 2.5rem 1rem;
    overflow-y: auto;
}
.jd-overlay.active { display: block; }
.jd-detail-panel {
    position: relative; max-width: 860px; margin: 0 auto;
    background: #fff; border-radius: 14px; padding: 1.4rem 1.6rem 1.6rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.28);
}
.jd-close-btn {
    position: absolute; top: 0.7rem; right: 0.8rem;
    width: 36px; height: 36px; border: none; border-radius: 50%;
    background: #eef1f4; color: #2c3e50; font-size: 1.3rem; cursor: pointer;
}
.jd-close-btn:hover { background: #e0e6ea; }

.jd-det-header { padding-right: 2.5rem; }
.jd-det-title { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.jd-det-title h2 { color: #2c3e50; margin: 0; }
.jd-det-desc { color: #444; margin: 0.4rem 0 0.8rem; line-height: 1.35; }
.jd-det-facts {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.45rem 1rem; margin-bottom: 1rem;
    font-size: 0.82rem; color: #2c3e50;
}
.jd-det-fact span {
    display: block; font-size: 0.65rem; font-weight: 700;
    color: #90a0ab; text-transform: uppercase; letter-spacing: 0.04em;
}

.jd-composer {
    background: #f6f9fc; border: 1px solid #e0e6ea; border-radius: 10px;
    padding: 0.9rem 1rem; margin-bottom: 1.1rem;
}
.jd-composer h3 { margin: 0 0 0.5rem; font-size: 0.95rem; color: #2c3e50; }
.jd-composer textarea {
    width: 100%; border: 1px solid #d5dbe0; border-radius: 8px;
    padding: 0.6rem 0.7rem; font-size: 0.88rem; font-family: inherit;
    resize: vertical; box-sizing: border-box;
}
.jd-composer-staged { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.5rem; }
.jd-staged { position: relative; display: inline-flex; align-items: center; }
.jd-staged img {
    width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
    border: 1px solid #d5dbe0;
}
.jd-staged-chip {
    background: #fff; border: 1px solid #d5dbe0; border-radius: 8px;
    padding: 0.3rem 0.5rem; font-size: 0.72rem; color: #2c3e50;
    max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jd-staged button {
    position: absolute; top: -6px; right: -6px;
    width: 18px; height: 18px; border: none; border-radius: 50%;
    background: #e74c3c; color: #fff; font-size: 0.7rem; line-height: 1;
    cursor: pointer; padding: 0;
}
.jd-staged-chip button { position: static; margin-left: 0.4rem; background: #b0bec5; }

.jd-composer-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.jd-attach-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid #d5dbe0; border-radius: 8px;
    background: #fff; font-size: 1.1rem; cursor: pointer;
}
.jd-attach-btn:hover { background: #f0f4f7; }
.jd-submit-btn {
    border: none; border-radius: 8px; background: #3498db; color: #fff;
    padding: 0.6rem 1.2rem; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.jd-submit-btn:hover { background: #2e86c1; }
.jd-submit-btn:disabled { background: #a9cce3; cursor: default; }
.jd-composer-msg { font-size: 0.78rem; color: #1e7e34; }
.jd-composer-msg.jd-composer-err { color: #c0392b; }

.jd-timeline-heading { color: #2c3e50; font-size: 0.98rem; margin: 0 0 0.6rem; }
.jd-timeline-empty { color: #90a0ab; font-size: 0.85rem; }
.jd-note {
    border-left: 3px solid #8e44ad; background: #fbf9fd;
    border-radius: 0 10px 10px 0;
    padding: 0.65rem 0.85rem; margin-bottom: 0.6rem;
}
.jd-note-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.jd-note-author { font-weight: 700; font-size: 0.8rem; color: #2c3e50; }
.jd-note-when { font-size: 0.72rem; color: #90a0ab; }
.jd-note-del {
    margin-left: auto; border: none; background: none; cursor: pointer;
    font-size: 0.85rem; opacity: 0.5;
}
.jd-note-del:hover { opacity: 1; }
.jd-note-body { font-size: 0.85rem; color: #333; white-space: pre-wrap; line-height: 1.4; }
.jd-note-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.5rem; }
.jd-note-photos img {
    width: 84px; height: 84px; object-fit: cover; border-radius: 8px;
    cursor: pointer; border: 1px solid #e0e6ea;
}
.jd-note-videos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.5rem; }
.jd-note-video {
    background: #2c3e50; color: #fff; border-radius: 8px;
    padding: 0.4rem 0.8rem; font-size: 0.78rem; cursor: pointer;
}
.jd-note-video:hover { background: #3d5166; }
.jd-note-files { display: flex; flex-direction: column; gap: 4px; margin-top: 0.5rem; }
.jd-note-file {
    font-size: 0.78rem; color: #2471a3; text-decoration: none;
    background: #fff; border: 1px solid #e0e6ea; border-radius: 8px;
    padding: 0.35rem 0.6rem; width: fit-content; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jd-note-file:hover { background: #f0f6fb; }

@media (max-width: 640px) {
    .jd-detail-panel { padding: 1rem; }
    .jd-overlay { padding: 1rem 0.5rem; }
}

@media (max-width: 900px) {
    .jd-td-desc { max-width: 200px; }
    .jd-table th:nth-child(7), .jd-table td:nth-child(7) { display: none; } /* Finished */
}

/* ============================================================================
   CUSTOMERS TAB - Horizontal bar-graph of open jobs grouped by customer
   ============================================================================ */

/* Break out of the 1200px max-width on .main-content when Customers tab is active
   so the dashboard uses the full viewport width. */
.main-content:has(#customers-tab.active) {
    max-width: none;
    padding-left: 1rem;
    padding-right: 1rem;
}

.customers-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    width: 100%;
}

.customers-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
}

.customers-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.customers-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.customers-toolbar input[type="text"] {
    flex: 1;
    min-width: 220px;
    max-width: 340px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 0.95rem;
}

.customers-count {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-left: auto;
}

.customers-chart {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0;
}

.customer-row {
    display: flex;
    background: #ffffff;
    border: 1px solid #e4e7ea;
    border-radius: 10px;
    overflow: hidden;
    min-height: 88px;
}

.customer-row-label {
    flex: 0 0 150px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 1px solid #1f2d3a;
}

.customer-row-label .customer-name {
    font-weight: 700;
    font-size: 0.88rem;
    word-break: break-word;
    line-height: 1.2;
}

.customer-row-label .customer-job-count {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.22);
    color: white;
    padding: 0.08rem 0.45rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.customer-row-track {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
    background: #f8f9fb;
    transition: background 0.15s ease;
}

.customer-row-track.drag-over {
    background: #e8f4fd;
    outline: 2px dashed #3498db;
    outline-offset: -4px;
}

.customer-row-empty {
    color: #95a5a6;
    font-size: 0.9rem;
    font-style: italic;
    padding: 1rem;
    align-self: center;
}

/* Customer cards use the .jobiq-card base styles; this class only adds the
   horizontal-track sizing, drag affordance, and drag-state visual. */
.customer-job-card {
    width: 210px;
    min-width: 210px;
    max-width: 210px;
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
    /* Slightly tighter than the default .jobiq-card so rows aren't too tall */
    min-height: 96px;
    padding: 0.55rem 0.65rem;
    gap: 0.25rem;
}

.customer-job-card:active {
    cursor: grabbing;
}

.customer-job-card.dragging {
    opacity: 0.4;
    transform: rotate(-1deg);
}

.customers-unassigned {
    margin: 1.25rem 0 0;
    border-top: 2px dashed #95a5a6;
    padding-top: 1rem;
}

.customers-unassigned-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.customers-unassigned-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.customers-unassigned-count {
    background: #95a5a6;
    color: white;
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.customers-unassigned-hint {
    color: #95a5a6;
    font-size: 0.85rem;
    font-style: italic;
    margin-left: auto;
}

.customers-unassigned-track {
    background: #fdf6e3;
    border: 1px dashed #d4a84b;
    border-radius: 10px;
    min-height: 100px;
}

@media (max-width: 640px) {
    .customer-row-label {
        flex: 0 0 110px;
        padding: 0.45rem 0.55rem;
    }
    .customer-row-label .customer-name { font-size: 0.8rem; }
    .customer-job-card {
        width: 180px;
        min-width: 180px;
        max-width: 180px;
    }
}

/* ============================================================
   Job Intel — Files & Notes section (job-level attachments)
   ============================================================ */
.jobiq-notes-wrap {
    margin-bottom: 1.25rem;
}
.jobiq-notes-wrap textarea {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.6rem;
    border: 1px solid #d4d8dd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
    resize: vertical;
}
.jobiq-notes-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
}
.jobiq-notes-actions button {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
}
.jobiq-notes-actions button:hover {
    background: #2980b9;
}
.jobiq-inline-msg { font-size: 0.85rem; color: #7f8c8d; }
.jobiq-inline-success { color: #27ae60; font-weight: 600; }

.jobiq-files-block {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ecf0f1;
}
.jobiq-files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.jobiq-files-hint {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    color: #95a5a6;
}
.jobiq-file-btn {
    display: inline-block;
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}
.jobiq-file-btn:hover {
    background: #d5dbdb;
}

.jobiq-photos-grid,
.jobiq-videos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.jobiq-photo-item,
.jobiq-video-item {
    position: relative;
    display: inline-block;
}
.jobiq-photo-item img {
    max-width: 140px;
    max-height: 105px;
    border-radius: 4px;
    cursor: pointer;
    display: block;
}
.jobiq-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(231, 76, 60, 0.92);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jobiq-remove-btn:hover { background: #c0392b; }

.jobiq-video-progress {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f4f6f8;
    border-radius: 4px;
}

/* ============================================================================
   SOP KNOWLEDGE BASE TAB
   ============================================================================ */

.sops-container { max-width: 980px; margin: 0 auto; }

.sops-header h2 { margin-bottom: 12px; color: #2c3e50; }

.sops-toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 18px;
}
.sops-toolbar input[type="text"] {
    flex: 1; min-width: 220px; padding: 8px 12px;
    border: 1px solid #dcdde1; border-radius: 6px; font-size: 14px;
}
.sops-toolbar select {
    padding: 8px 10px; border: 1px solid #dcdde1; border-radius: 6px;
    font-size: 14px; background: #fff;
}
.sops-count { color: #7f8c8d; font-size: 13px; white-space: nowrap; }

.sops-group-title {
    margin: 18px 0 8px; font-size: 15px; text-transform: uppercase;
    letter-spacing: 0.5px; color: #7f8c8d;
    border-bottom: 2px solid #ecf0f1; padding-bottom: 4px;
}

.sop-card {
    background: #fff; border: 1px solid #e6e8eb; border-left: 4px solid #3498db;
    border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.sop-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.10); transform: translateY(-1px); }
.sop-card-draft { border-left-color: #e67e22; }

.sop-card-title { font-weight: 600; color: #2c3e50; font-size: 15px; }
.sop-card-meta { color: #7f8c8d; font-size: 12.5px; margin-top: 4px; }

.sop-draft-badge {
    display: inline-block; margin-left: 8px; padding: 1px 8px;
    background: #e67e22; color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 10px; vertical-align: middle;
}

.sops-loading, .sops-empty { padding: 30px; text-align: center; color: #7f8c8d; }

.sop-back-btn {
    margin-bottom: 14px; padding: 8px 14px; border: 1px solid #dcdde1;
    background: #fff; border-radius: 6px; cursor: pointer; font-size: 14px;
    color: #3498db;
}
.sop-back-btn:hover { background: #f5f6fa; }

.sop-body {
    background: #fff; border: 1px solid #e6e8eb; border-radius: 8px;
    padding: 26px 32px; line-height: 1.55; color: #2c3e50;
}
.sop-body h1 { font-size: 24px; margin: 0 0 14px; }
.sop-body h2 { font-size: 18px; margin: 22px 0 8px; border-bottom: 1px solid #ecf0f1; padding-bottom: 4px; }
.sop-body h3 { font-size: 15px; margin: 16px 0 6px; }
.sop-body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13.5px; }
.sop-body th, .sop-body td { border: 1px solid #dcdde1; padding: 6px 9px; text-align: left; }
.sop-body th { background: #f5f6fa; }
.sop-body blockquote {
    margin: 10px 0; padding: 10px 14px; background: #fdf3e6;
    border-left: 4px solid #e67e22; color: #7a5b1e;
}
.sop-body code { background: #f5f6fa; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.sop-body ol li, .sop-body ul li { margin-bottom: 4px; }

.sop-sources {
    margin-top: 16px; background: #fff; border: 1px solid #e6e8eb;
    border-radius: 8px; padding: 16px 22px;
}
.sop-sources h4 { margin: 0 0 8px; color: #2c3e50; }
.sop-sources a { color: #3498db; text-decoration: none; }
.sop-sources a:hover { text-decoration: underline; }
.sop-doc-meta { color: #7f8c8d; font-size: 12px; margin-left: 4px; }
