/* ============================================
   UNIFIED JOB MANAGEMENT STYLES
   ============================================
   Extracted from UnifiedJobManagement.js for better maintainability
   Last updated: 2026-01-06
*/

/* Container */
.unified-jobs-container {
    /* Transparent - page handles card styling */
}

/* ========================================
   OVERVIEW MAP SECTION
   ======================================== */
.overview-map-section {
    margin-bottom: 16px;
}

.overview-map-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary, #495057);
    transition: all 0.2s ease;
}

.overview-map-toggle:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--color-primary, #3498db);
    color: var(--color-primary, #3498db);
}

.overview-map-toggle:active {
    transform: scale(0.98);
}

.toggle-icon {
    font-size: 1.2rem;
}

.toggle-chevron {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.overview-map-container {
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color, #dee2e6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.active-jobs-map {
    background: #f0f0f0;
}

/* Map loading state */
.active-jobs-map .map-loading {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Map legend styling */
.active-jobs-map .map-legend {
    font-family: inherit !important;
}

/* Mobile adjustments for map */
@media (max-width: 767px) {
    .overview-map-toggle {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .overview-map-container {
        margin-top: 8px;
    }

    .active-jobs-map {
        height: 250px !important;
    }
}

/* ========================================
   iOS-STYLE SEGMENT CONTROL
   ======================================== */
.segment-control-wrapper {
    margin-bottom: 16px;
}

.segment-control {
    display: inline-flex;
    background: #f1f3f4;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
    width: 100%;
}

.segment {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 60px;
}

.segment-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5f6368;
    margin-bottom: 2px;
}

.segment-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: #5f6368;
}

.segment:hover {
    background: rgba(255, 255, 255, 0.5);
}

.segment.active {
    background: var(--color-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
}

.segment.active .segment-label {
    color: white;
}

.segment.active .segment-count {
    color: white;
    background: rgba(255,255,255,0.3);
}

/* Secondary filter dropdown */
.secondary-filter {
    margin-bottom: 16px;
}

.status-dropdown {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: white;
    font-size: 0.85rem;
    color: #5f6368;
    cursor: pointer;
    min-width: 140px;
}

.status-dropdown:focus {
    outline: none;
    border-color: #1a73e8;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #202124;
}

.empty-state p {
    margin: 0;
    color: #5f6368;
    font-size: 0.9rem;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .segment-control {
        padding: 3px;
    }

    .segment {
        padding: 10px 6px;
        min-height: 54px;
    }

    .segment-label {
        font-size: 0.75rem;
    }

    .segment-count {
        font-size: 1.1rem;
    }

    .secondary-filter {
        margin-bottom: 12px;
    }

    .status-dropdown {
        width: 100%;
        padding: 10px 12px;
    }
}

/* ========================================
   LEGACY STATUS TABS (keeping for compatibility)
   ======================================== */
.status-filter-tabs {
    display: none; /* Hidden - using segment control instead */
}

.category-filter-section {
    background: var(--color-background);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 3px solid var(--color-primary);
}

.category-label {
    font-size: 0.85rem;
    color: var(--color-text-muted, #7f8c8d);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.category-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid var(--color-border);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: var(--color-text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.category-btn:hover {
    border-color: var(--color-primary);
    background: #ecf7ff;
    transform: translateY(-1px);
}

.category-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.unified-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ========================================
   EXPANDABLE JOB CARD STYLES
   ======================================== */
.unified-job-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.unified-job-card:hover {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    border-color: var(--color-primary);
}

/* Card needs action - orange highlight */
.unified-job-card.needs-action {
    border-left: 4px solid var(--color-warning);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.2);
}

/* Card waiting on other party - blue subtle */
.unified-job-card.waiting-other {
    border-left: 4px solid var(--color-primary);
}

/* Card with active driving session - green */
.unified-job-card.driving-active {
    border-left: 4px solid var(--color-success, #27ae60);
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.03) 0%, white 15%);
}

/* Expandable header (always visible) */
.unified-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    background: white;
    border: none;
    cursor: pointer;
    text-align: left;
    gap: 12px;
    transition: background 0.2s;
}

.unified-card-header:hover {
    background: var(--color-background);
}

.unified-card-header:focus {
    outline: none;
}

.unified-card-header:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.header-main {
    flex: 1;
    min-width: 0;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.header-title .job-title-header {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text-primary);
}

/* Counterparty in header - shown when collapsed, hidden when expanded */
.header-title .counterparty-collapsed {
    font-size: 0.8rem;
    color: var(--color-text-muted, #7f8c8d);
    font-weight: 400;
    transition: opacity 0.2s ease;
}

/* Hide counterparty in header when card is expanded */
.unified-job-card.expanded .counterparty-collapsed {
    display: none;
}

/* Hide price/date in header when card is expanded (shown in expanded content instead) */
.unified-job-card.expanded .header-meta {
    display: none;
}

/* Hide route in header when card is expanded (shown in expanded content instead) */
.unified-job-card.expanded .header-route-row {
    display: none;
}

/* Expanded header styling - blue background to indicate active/expanded state */
.unified-job-card.expanded .unified-card-header {
    background: linear-gradient(135deg, #e8f4fc 0%, #d4e9f7 100%);
    border-bottom: 1px solid #b8d4e8;
}

.unified-job-card.expanded .unified-card-header:hover {
    background: linear-gradient(135deg, #dceef8 0%, #c8e0f0 100%);
}

/* Counterparty in expanded content - hidden by default, shown when expanded */
.counterparty-expanded {
    display: none;
}

.unified-job-card.expanded .counterparty-expanded {
    display: block;
}

.header-route-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.header-route {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.header-goods {
    font-size: 0.8rem;
    color: var(--color-text-muted, #7f8c8d);
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
}

.header-vehicle {
    font-size: 0.8rem;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Legacy styles - keep for backwards compatibility */
.header-title .counterparty {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text-primary);
}

.header-title .job-id-small {
    font-size: 0.8rem;
    color: var(--color-text-light, #95a5a6);
}

.header-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--color-text-muted, #7f8c8d);
}

.header-price {
    font-weight: 600;
    color: var(--color-success);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Completion badge in header */
.completion-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.completion-badge.needs-action {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

.completion-badge.waiting {
    background: #e3f2fd;
    color: #1565c0;
}

.completion-badge.invoiced {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.completion-badge.driving {
    background: linear-gradient(135deg, #d4edda 0%, #b8e0c3 100%);
    color: #1a6b32;
    animation: pulse-driving 1.5s ease-in-out infinite;
}

@keyframes pulse-driving {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Live tracking badge - shows when driver is actively tracking */
.live-tracking-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    margin-left: 8px;
}

.live-tracking-badge .status-pulse {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.job-status-badge-small {
    background: var(--color-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.expand-chevron {
    font-size: 0.8rem;
    color: var(--color-text-light, #95a5a6);
    transition: transform 0.3s ease;
}

/* Expanded state - rotate chevron */
.unified-job-card.expanded .expand-chevron {
    transform: rotate(180deg);
}

/* Expandable content (hidden by default) */
.unified-card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
    border-top: 1px solid transparent;
}

.unified-job-card.expanded .unified-card-content {
    max-height: none;
    overflow: visible;
    padding: 16px 20px 20px;
    border-top-color: #f0f0f0;
}

/* Status banners in expanded content */
.status-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-banner .banner-icon {
    font-size: 1.2rem;
}

.status-banner.rejected {
    background: #ffebee;
    color: #c62828;
    border-left: 3px solid #ef5350;
}

.status-banner.cancelled-self {
    background: #ffebee;
    color: #c62828;
    border-left: 3px solid #ef5350;
}

.status-banner.cancelled-other {
    background: #fff8e1;
    color: #f57f17;
    border-left: 3px solid #ffca28;
}

/* Job title banner */
.job-title-banner {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.job-title-label {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.job-title-value {
    font-weight: 600;
    font-size: 1rem;
}

/* Application message section */
.application-message-section {
    background: #f0f7ff;
    border-left: 4px solid var(--color-primary);
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 12px;
}

.message-label {
    font-size: 0.75rem;
    color: var(--color-primary-dark);
    font-weight: 600;
    margin-bottom: 6px;
}

.message-content {
    color: var(--color-text-primary);
    font-style: italic;
    line-height: 1.5;
}

/* Legacy styles for backwards compatibility */
.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.job-id {
    font-size: 0.85rem;
    color: var(--color-text-light, #95a5a6);
    background: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 500;
}

.job-status-badge {
    background: var(--color-primary);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.supplier-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--color-warning);
    margin-bottom: 15px;
}

.supplier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.supplier-details {
    flex: 1;
}

.supplier-name {
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 3px;
}

.supplier-rating {
    font-size: 0.85rem;
    color: var(--color-warning);
}

.supplier-message-btn {
    padding: 8px 16px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.supplier-message-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

.job-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.job-detail-item {
    display: flex;
    flex-direction: column;
}

.job-detail-label {
    font-size: 0.75rem;
    color: var(--color-text-light, #95a5a6);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.job-detail-value {
    font-size: 1rem;
    color: var(--color-text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* Route spans full width in grid */
.job-detail-route {
    grid-column: 1 / -1;
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--color-background) 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 3px solid var(--color-primary);
}

.job-detail-route .job-detail-value {
    font-size: 0.95rem;
}

/* Price comparison in expanded card */
.price-comparison-expanded {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.price-original-small {
    color: var(--color-text-light, #95a5a6);
    text-decoration: line-through;
    font-size: 0.9rem;
}

.price-arrow {
    color: var(--color-text-muted, #7f8c8d);
    font-size: 0.85rem;
}

.price-final,
.price-pending {
    font-weight: 600;
}

.price-final.price-increase,
.price-pending.price-increase {
    color: var(--color-success);
}

.price-final.price-decrease,
.price-pending.price-decrease {
    color: #e67e22;
}

.price-diff {
    font-size: 0.8rem;
    font-weight: 500;
}

.price-diff.price-increase {
    color: var(--color-success);
}

.price-diff.price-decrease {
    color: #e67e22;
}

/* Advanced details section (expanded view) */
.advanced-details-section {
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, var(--color-background) 0%, #f0f4f8 100%);
    border-radius: 10px;
    border-left: 3px solid var(--color-primary, var(--color-primary));
}

.advanced-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.advanced-row:last-child {
    margin-bottom: 0;
}

.advanced-label {
    font-weight: 600;
    color: var(--color-text-primary);
    min-width: 120px;
    font-size: 0.9rem;
}

.advanced-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.load-item, .time-item, .contact-item, .vehicle-item {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #34495e;
    border: 1px solid #e9ecef;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.contact-phone {
    text-decoration: none;
    color: var(--color-primary-dark);
}

.contact-phone:hover {
    background: #e8f4f8;
}

.req-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.req-tag {
    padding: 8px 12px;
    background: #e8f4f8;
    color: var(--color-primary-dark);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.req-tag.req-adr {
    background: #fff3cd;
    color: #856404;
}

.special-instructions {
    margin: 5px 0 0 0;
    padding: 10px;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-style: italic;
    border: 1px solid #e9ecef;
    width: 100%;
}

.instructions-row {
    flex-direction: column;
    align-items: flex-start;
}

.job-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
}

@media (max-width: 767px) {
    .job-actions {
        flex-wrap: wrap;
    }
    .job-actions .btn-job,
    .job-actions .btn-job-view {
        flex: 1 1 100%;
    }

    /* Mobile: HIDE advanced details in cards - user should click "Se detaljer" */
    .advanced-details-section {
        display: none !important;
    }

    /* Hide non-essential details on mobile cards */
    .job-detail-item.hide-on-mobile {
        display: none !important;
    }
}

.btn-job {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-job-view {
    background: var(--color-primary);
    color: white;
    flex: 0 0 auto;
}

.btn-job-view:hover {
    background: var(--color-primary-dark);
}

.btn-job-complete {
    background: var(--color-success);
    color: white;
}

.btn-job-complete:hover {
    background: var(--color-success);
}

.btn-job-accept {
    background: var(--color-success);
    color: white;
}

.btn-job-accept:hover {
    background: var(--color-success-dark, #1e7e34);
}

.btn-job-message {
    background: #9b59b6;
    color: white;
}

.btn-job-message:hover {
    background: #8e44ad;
}

.btn-job-reject,
.btn-job-cancel {
    background: var(--color-error);
    color: white;
}

.btn-job-reject:hover,
.btn-job-cancel:hover {
    background: var(--color-error-dark, #bd2130);
}

.btn-job-warning {
    background: var(--color-warning);
    color: white;
}

.btn-job-warning:hover {
    background: var(--color-warning-dark, #c79100);
}

.btn-job-withdraw {
    background: var(--color-error);
    color: white;
}

.btn-job-withdraw:hover {
    background: var(--color-error-dark, #bd2130);
}

/* Completed job buttons - invoice and review */
.btn-job-invoice,
.btn-job-create-invoice {
    background: #17a2b8;
    color: white;
}

.btn-job-invoice:hover,
.btn-job-create-invoice:hover {
    background: #138496;
}

/* Commission invoice button for suppliers */
.btn-job-commission-invoice {
    background: #6f42c1;
    color: white;
}

.btn-job-commission-invoice:hover {
    background: #5a32a3;
}

.btn-job-review {
    background: var(--color-warning);
    color: #212529;
}

.btn-job-review:hover {
    background: var(--color-warning-dark, #c79100);
}

.btn-job-reviewed {
    background: var(--color-success);
    color: white;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Completion Notice Banner - the yellow notification */
.completion-notice-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid var(--color-warning);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.completion-notice-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.completion-notice-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.completion-notice-text strong {
    color: #856404;
    font-size: 0.95rem;
}

.completion-notice-text span {
    color: #856404;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Completion Status Wrapper - contains banner + undo button */
.completion-status-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

@media (max-width: 767px) {
    .completion-status-wrapper {
        flex: 1 1 100%;
        flex-wrap: wrap;
    }
}

/* Completion Waiting Banner - for "waiting for other party" state */
.completion-waiting-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #64b5f6;
    border-radius: 8px;
    padding: 10px 14px;
    flex: 1;
    min-width: 200px;
}

@media (max-width: 767px) {
    .completion-waiting-banner {
        flex: 1 1 100%;
        min-width: unset;
    }
}

/* Undo button styling */
.btn-undo {
    background: #6c757d !important;
    color: white !important;
    white-space: nowrap;
    padding: 10px 16px !important;
}

.btn-undo:hover {
    background: #5a6268 !important;
}

.completion-waiting-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.completion-waiting-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.completion-waiting-text strong {
    color: #1565c0;
    font-size: 0.85rem;
    font-weight: 600;
}

.completion-waiting-subtext {
    color: #1976d2;
    font-size: 0.75rem;
    opacity: 0.85;
}

/* Completion Actions - button group */
.completion-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.completion-actions .btn-job {
    flex: 1;
}

.unified-jobs-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--color-text-muted, #7f8c8d);
}

.unified-jobs-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.unified-jobs-empty p {
    margin: 5px 0;
}

.unified-jobs-empty .empty-subtext {
    font-size: 0.9rem;
    color: var(--color-text-light, #95a5a6);
}

/* Pending Requests Section */
.pending-requests-container {
    background: #fff3cd;
    border: 2px solid var(--color-warning);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.pending-requests-container h3 {
    margin: 0 0 5px 0;
    color: #856404;
    font-size: 1.2rem;
}

.pending-requests-container .subtitle {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 0.9rem;
    opacity: 0.8;
}

.pending-requests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pending-request-card {
    background: white;
    border: 1px solid var(--color-warning);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.request-time {
    color: var(--color-text-muted, #7f8c8d);
    font-size: 0.85rem;
}

.request-body h4 {
    margin: 0 0 8px 0;
    color: var(--color-text-primary);
    font-size: 1.05rem;
}

.request-body p {
    margin: 5px 0;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.request-reason {
    font-style: italic;
    color: var(--color-text-muted, #7f8c8d);
    font-size: 0.9rem;
    margin-top: 8px;
}

.request-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn-approve, .btn-deny {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-approve {
    background: var(--color-success);
    color: white;
}

.btn-approve:hover {
    background: var(--color-success-dark, #1e7e34);
}

.btn-deny {
    background: var(--color-error);
    color: white;
}

.btn-deny:hover {
    background: var(--color-error-dark, #bd2130);
}

/* Pending Request Banner on Job Cards */
.pending-request-banner {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid var(--color-warning);
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: pulse 2s ease-in-out infinite;
}

.pending-request-icon {
    font-size: 1.5rem;
    animation: rotate 2s linear infinite;
}

.pending-request-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pending-request-text strong {
    color: #856404;
    font-size: 0.95rem;
}

.pending-request-text span {
    color: #856404;
    font-size: 0.85rem;
    opacity: 0.9;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Rejection Banner Styles */
.rejection-banner {
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rejection-banner.supplier-rejected {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
    border-left: 4px solid var(--color-error);
}

.rejection-banner.driver-rejected {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid var(--color-warning);
}

.rejection-icon {
    font-size: 1.5rem;
}

.rejection-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rejection-banner.supplier-rejected .rejection-text strong {
    color: #842029;
    font-size: 0.95rem;
}

.rejection-banner.supplier-rejected .rejection-text span {
    color: #842029;
    font-size: 0.85rem;
    opacity: 0.9;
}

.rejection-banner.driver-rejected .rejection-text strong {
    color: #856404;
    font-size: 0.95rem;
}

.rejection-banner.driver-rejected .rejection-text span {
    color: #856404;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ========================================
   JOB DETAILS MODAL STYLES
   ======================================== */
.job-details-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.job-details-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden; /* Prevent scroll on whole modal */
}

.job-details-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0; /* Header stays fixed size */
}

.job-details-modal .modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.job-details-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: white;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.job-details-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
    color: white;
}

.job-details-modal .modal-body {
    padding: 20px;
    overflow-y: auto; /* Scroll only in body */
    flex: 1;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    margin: 0 0 15px 0;
    color: var(--color-text-primary);
    font-size: 1.1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.detail-label {
    color: var(--color-text-muted, #7f8c8d);
    font-weight: 600;
    font-size: 0.9rem;
}

.detail-value {
    color: var(--color-text-primary);
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    min-width: 0;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 10px;
}

.btn-close {
    flex: 1;
    padding: 10px 20px;
    background: var(--color-text-light, #95a5a6);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: var(--color-text-muted, #7f8c8d);
}

/* ========================================
   TRACKING CONTROL (Start Drive)
   ======================================== */
.tracking-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.tracking-control.tracking-active {
    background: #e8f5e9;
    border-color: #a5d6a7;
}

.tracking-icon {
    font-size: 1.4em;
    flex-shrink: 0;
}

.tracking-info {
    flex: 1;
    min-width: 0;
}

.tracking-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.tracking-title.active {
    color: #2e7d32;
}

.tracking-subtitle {
    font-size: 0.85em;
    color: #666;
}

.tracking-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.tracking-buttons .btn {
    padding: 10px 16px;
    min-width: auto;
    white-space: nowrap;
}

.tracking-buttons .btn-sm {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Mobile: Stack layout */
@media (max-width: 480px) {
    .tracking-control {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
    }

    .tracking-info {
        flex: 1 1 calc(100% - 50px);
    }

    .tracking-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .tracking-buttons .btn {
        flex: 1;
        padding: 12px 10px;
    }
}
