/* ========================================
   Dispatch Board — InspectSync
   ======================================== */

/* Override dashboard-content when dispatch page is active */
.dashboard-content:has(.dispatch-page) {
    padding: 0;
    overflow: hidden;
}

.dispatch-page {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

/* ========================================
   Toolbar (Filters + Date Nav)
   ======================================== */
.dispatch-toolbar {
    display: flex;
    /* Seven filter buttons plus two checkboxes outgrow the row at 100% zoom on a
       laptop; without wrapping, the date navigation was pushed past the right edge
       and clipped by .dispatch-page's overflow:hidden. */
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* ========================================
   Date Navigation
   ======================================== */
.date-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Match Team Scheduling / Monthly scroller button sizing for consistency. */
.date-navigation .btn {
    padding: 6px 12px;
    font-size: 13px;
}

.date-display {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    min-width: 180px;
    text-align: center;
    user-select: none;
}

.filter-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-toggle-btn {
    position: relative;
}

.show-scheduled-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    margin-left: 4px;
}

.show-scheduled-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #059669;
}

.filter-toggle-btn.active {
    background: #ecfdf5;
    border-color: #059669;
    color: #059669;
}

.filter-count {
    display: none;
    align-items: center;
    justify-content: center;
    background: #059669;
    color: #ffffff;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
    min-width: 18px;
    line-height: 1.3;
}

.filter-count.visible {
    display: inline-flex;
}

/* ========================================
   Filter Dropdowns
   ======================================== */
.filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 260px;
    max-height: 320px;
    overflow: hidden;
}

.filter-dropdown.open {
    display: block;
}

.filter-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.filter-dropdown-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    font-size: 14px;
    line-height: 1;
}

.filter-dropdown-close:hover {
    color: #475569;
}

.filter-options {
    padding: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease;
    user-select: none;
    font-size: 13px;
    color: #334155;
}

.filter-option:hover {
    background: #f1f5f9;
}

.filter-option.selected {
    background: #ecfdf5;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #059669;
    flex-shrink: 0;
}

.filter-option label {
    cursor: pointer;
    flex: 1;
}

.filter-option .filter-option-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========================================
   Filter Chips Row
   ======================================== */
.filter-chips-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.filter-chips-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: #ecfdf5;
    border: 1px solid #059669;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #065f46;
}

.filter-chip-remove {
    background: none;
    border: none;
    color: #059669;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.filter-chip-remove:hover {
    color: #047857;
}

.filter-clear-all-btn {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 12px;
}

/* ========================================
   Split Pane (Map + Dispatch)
   ======================================== */
.split-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-section {
    height: 50%;
    min-height: 120px;
    position: relative;
    flex-shrink: 0;
}

.dispatch-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Map Layer Toggle */
.map-layer-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.map-layer-btn {
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.map-layer-btn:first-child {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.map-layer-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.map-layer-btn.active {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.map-layer-btn:hover:not(.active) {
    background: #f8fafc;
}

/* Fit Markers Button */
.map-fit-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 1000;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Custom Map Marker */
.map-marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Map Popup */
.map-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0;
}

.map-popup .leaflet-popup-content {
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    min-width: 200px;
}

.popup-content {
    padding: 12px;
}

.popup-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.popup-desc {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.popup-meta {
    font-size: 11px;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.popup-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.popup-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
}

/* ========================================
   Split Handle
   ======================================== */
.split-handle {
    height: 6px;
    background: #e2e8f0;
    cursor: row-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 20;
    transition: background 0.15s ease;
}

.split-handle:hover {
    background: #cbd5e1;
}

.split-handle-grip {
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: #94a3b8;
}

/* ========================================
   Dispatch Section (Bottom Half)
   ======================================== */
.dispatch-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.dispatch-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ========================================
   Technician List (Left Column)
   ======================================== */
.tech-list {
    width: 240px;
    min-width: 240px;
    background: #ffffff;
    border-right: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 10;
    flex-shrink: 0;
}

.tech-list-header {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.tech-list-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tech-list-body::-webkit-scrollbar {
    display: none;
}

.tech-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 60px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.tech-row:nth-child(even) {
    background: #f8fafc;
}

.tech-row:hover {
    background: #f8fafc;
}

.tech-row.selected {
    background: #f1f5f9;
}

.tech-info {
    flex: 1;
    min-width: 0;
}

.tech-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tech-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.tech-job-count {
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    padding: 1px 6px;
    border-radius: 10px;
}

/* ========================================
   Grid Scroll Wrapper
   ======================================== */
.grid-scroll-wrapper {
    flex: 1;
    overflow: auto;
    position: relative;
}

/* Custom Scrollbar */
.grid-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.grid-scroll-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.grid-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.grid-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   Time Header
   ======================================== */
.time-header {
    display: flex;
    height: 40px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 5;
}

.time-hour-label {
    width: 120px;
    min-width: 120px;
    height: 40px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    border-left: 1px solid #e2e8f0;
    position: relative;
}

.time-hour-label:first-child {
    border-left: none;
}

/* ========================================
   Swim Lanes
   ======================================== */
.swim-lanes {
    position: relative;
}

.swim-lane {
    position: relative;
    height: 60px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.15s ease;
}

.swim-lane:nth-child(even) {
    background: #f8fafc;
}

.swim-lane.selected {
    background: #f8fafc;
}

.swim-lane.drop-target {
    background: rgba(5, 150, 105, 0.04);
    outline: 2px dashed #059669;
    outline-offset: -2px;
}

/* Grid Lines */
.grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e2e8f0;
    pointer-events: none;
    z-index: 1;
}

.grid-line.half-hour {
    background: transparent;
    border-left: 1px dashed #f1f5f9;
}

/* ========================================
   Job Cards
   ======================================== */
.job-card {
    position: absolute;
    top: 6px;
    height: 48px;
    border-radius: 6px;
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: grab;
    z-index: 3;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 8px 0 8px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.job-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    z-index: 4;
}

.job-card:active {
    cursor: grabbing;
}

.job-card.dragging {
    opacity: 0.85;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
    z-index: 100;
    cursor: grabbing;
    transition: none;
}

.job-card.highlighted {
    outline: 2px solid #0f172a;
    outline-offset: -1px;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.3), 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.job-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.job-card-time {
    font-size: 10px;
    font-weight: 600;
    color: #1e3a8a;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.job-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e3a8a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-card-desc {
    font-size: 10px;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.job-card-desc-text {
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.job-card-attrs {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    vertical-align: middle;
}

.job-card-attr-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Resize Handle */
.job-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    z-index: 5;
}

.job-resize-handle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.job-card.resizing {
    z-index: 100;
    transition: none;
}

/* Priority Color Variants (Left Border Only) */
.job-card.priority-low {
    border-left-color: #3b82f6;
}

.job-card.priority-medium {
    border-left-color: #f59e0b;
}

.job-card.priority-high {
    border-left-color: #f97316;
}

.job-card.priority-urgent {
    border-left-color: #ef4444;
}

/* Compact "day X of Y" badge, right-justified on the job-type (desc) line so the narrow card
   can't clip it and it never collides with the time text. */
.dispatch-day-chip-badge {
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 6px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    color: #1e3a8a;
}

/* Job Type Color (Background + Text) */
.job-card.job-type-inspection {
    background: #d1fae5;
}

.job-card.job-type-inspection .job-card-title,
.job-card.job-type-inspection .job-card-time,
.job-card.job-type-inspection .job-card-desc {
    color: #065f46;
}

.job-card.job-type-service {
    background: #dbeafe;
}

.job-card.job-type-service .job-card-title,
.job-card.job-type-service .job-card-time,
.job-card.job-type-service .job-card-desc {
    color: #1e3a8a;
}

/* ========================================
   Current Time Indicator
   ======================================== */
.current-time-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dc2626;
    z-index: 8;
    pointer-events: none;
    display: none;
}

.current-time-dot {
    position: absolute;
    top: 0;
    left: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc2626;
}

/* ========================================
   Leaflet Popup Overrides
   ======================================== */
.leaflet-popup-content {
    margin: 0 !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    padding: 0 !important;
}

/* ========================================
   Dispatch Body (Horizontal Flex Container)
   ======================================== */
.dispatch-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.dispatch-body .split-pane {
    flex: 1;
    min-width: 0;
}

/* ========================================
   Pending Jobs Panel (Right Side)
   ======================================== */
.jobs-panel {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    border-left: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.25s ease, min-width 0.25s ease, border 0.25s ease, opacity 0.25s ease;
}

.jobs-panel.collapsed {
    width: 0;
    min-width: 0;
    border-left: none;
    opacity: 0;
    overflow: hidden;
}

/* Panel Header */
.jobs-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.jobs-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.panel-toggle-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 12px;
}

.panel-toggle-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Panel Expand Button (shown when collapsed) */
.panel-expand-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-right: none;
    border-radius: 6px 0 0 6px;
    width: 24px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    z-index: 20;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.06);
    transition: all 0.15s ease;
    font-size: 11px;
}

.panel-expand-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Panel Filters */
.jobs-panel-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    position: relative;
}

/* Pending count pill (right-aligned) */
.panel-pending-pill {
    margin-left: auto;
    flex-shrink: 0;
    background: #059669;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    min-width: 22px;
    text-align: center;
}

/* Anticipated-start-date filter */
.panel-filter-btn.has-filter { background: #ecfdf5; border-color: #059669; color: #047857; }
.panel-date-dropdown { min-width: 220px; }
.panel-date-body { padding: 10px; }
.panel-date-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 12px; color: #475569; }
.panel-date-row input { border: 1px solid #e1e8ef; border-radius: 6px; padding: 4px 6px; font-size: 12px; }
.panel-date-reset { width: 100%; margin-top: 4px; border: none; background: #f1f5f9; color: #334155; border-radius: 6px; padding: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.panel-date-reset:hover { background: #e2e8f0; }

.panel-filter-buttons {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

/* Pending-jobs filter buttons — match the Monthly view's .ms-filter-btn. */
.panel-filter-btn {
    position: relative;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    border-radius: 8px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: none;
}

.panel-filter-btn:hover {
    border-color: #cbd5e1;
    background: #ffffff;
    color: #475569;
}

.panel-filter-btn.active,
.panel-filter-btn.has-filter {
    background: #ecfdf5;
    border-color: #059669;
    color: #047857;
}

.panel-filter-count {
    display: none;
    align-items: center;
    justify-content: center;
    background: #059669;
    color: #ffffff;
    border-radius: 999px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 3px;
    min-width: 15px;
    line-height: 1.4;
}

.panel-filter-count.visible {
    display: inline-flex;
}

.panel-clear-btn {
    padding: 4px 8px;
    font-size: 11px;
    flex-shrink: 0;
}

/* Panel Filter Dropdowns */
.panel-filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 280px;
    overflow: hidden;
}

.panel-filter-dropdown.open {
    display: block;
}

.panel-filter-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
}

.panel-filter-dropdown-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    font-size: 13px;
    line-height: 1;
}

.panel-filter-dropdown-close:hover {
    color: #475569;
}

.panel-filter-options {
    padding: 4px;
    max-height: 220px;
    overflow-y: auto;
}

.panel-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease;
    user-select: none;
    font-size: 12px;
    color: #334155;
}

.panel-filter-option:hover {
    background: #f1f5f9;
}

.panel-filter-option.selected {
    background: #ecfdf5;
}

.panel-filter-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #059669;
    flex-shrink: 0;
}

.panel-filter-option label {
    cursor: pointer;
    flex: 1;
}

.panel-filter-option .panel-option-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Panel Search */
.jobs-panel-search {
    padding: 8px 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.jobs-panel-search .form-input {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s ease;
    font-family: inherit;
}

.jobs-panel-search .form-input:focus {
    border-color: #059669;
}

/* Pending-card footer Inspection / Service color legend */
.jobs-panel-type-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fafafa;
    font-size: 12px;
    color: #64748b;
    flex-shrink: 0;
}

.jobs-panel-type-legend .type-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.jobs-panel-type-legend .type-legend-sw {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.jobs-panel-type-legend .type-legend-insp {
    background: #d1fae5;
    border: 1px solid #065f46;
}

.jobs-panel-type-legend .type-legend-svc {
    background: #dbeafe;
    border: 1px solid #1e3a8a;
}

/* Pending Jobs List */
.pending-jobs-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.pending-jobs-list::-webkit-scrollbar {
    width: 6px;
}

.pending-jobs-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.pending-jobs-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.pending-jobs-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Pending Job Card */
.pending-job-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: grab;
    transition: all 0.15s ease;
}

.pending-job-card:active {
    cursor: grabbing;
}

.pending-job-card.dragging-source {
    opacity: 0.4;
}

.pending-job-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    filter: brightness(0.97);
}

.pending-job-card:last-child {
    margin-bottom: 0;
}

.pending-job-card.priority-low {
    border-left-color: #3b82f6;
}

.pending-job-card.priority-medium {
    border-left-color: #f59e0b;
}

.pending-job-card.priority-high {
    border-left-color: #f97316;
}

.pending-job-card.priority-urgent {
    border-left-color: #ef4444;
}

/* Pending Job Card — Job Type Color (Background + Text) */
.pending-job-card.job-type-inspection {
    background: #d1fae5;
}

.pending-job-card.job-type-inspection .pending-job-card-building,
.pending-job-card.job-type-inspection .pending-job-card-customer {
    color: #065f46;
}

.pending-job-card.job-type-service {
    background: #dbeafe;
}

.pending-job-card.job-type-service .pending-job-card-building,
.pending-job-card.job-type-service .pending-job-card-customer {
    color: #1e3a8a;
}

.pending-job-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.pending-job-card-building {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.pending-job-card-building i {
    margin-top: 2px;
    opacity: 0.85;
    flex-shrink: 0;
}

.pending-job-card-building span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-job-card-duration {
    font-size: 11px;
    color: #059669;
    background: #d1fae5;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.pending-job-card-times {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.pending-job-card-days {
    font-size: 11px;
    color: #4338ca;
    background: #e0e7ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.pending-job-card-customer {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.pending-job-card-customer i {
    opacity: 0.8;
    flex-shrink: 0;
}

.pending-job-card-customer span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-job-card-attrs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 3px;
}

.pending-job-card-attr-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.pending-job-card-typerow {
    margin-top: 2px;
}

.pending-job-card-type {
    display: inline-block;
    max-width: 100%;
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #ffffff;
    background: #3b82f6;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty State */
.panel-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #94a3b8;
    text-align: center;
}

.panel-no-results i {
    font-size: 32px;
    margin-bottom: 10px;
}

.panel-no-results p {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

/* Horizontal Legend Bar (under technician rows) */
.dispatch-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 28px;
    padding: 8px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fafafa;
    flex-shrink: 0;
}

.dispatch-legend-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dispatch-legend-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.dispatch-legend .jobs-panel-legend-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.jobs-panel-legend-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.jobs-panel-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #475569;
}

.jobs-panel-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Stats Footer */
.jobs-panel-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fafafa;
    flex-shrink: 0;
}

.panel-stat {
    text-align: center;
}

.panel-stat-value {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.panel-stat-label {
    font-size: 9px;
    color: #64748b;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Pending Drag Ghost
   ======================================== */
.pending-drag-ghost {
    position: fixed;
    height: 48px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    pointer-events: none;
    opacity: 0.9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 10px;
}

.pending-drag-ghost.priority-low {
    border-left-color: #3b82f6;
}

.pending-drag-ghost.priority-medium {
    border-left-color: #f59e0b;
}

.pending-drag-ghost.priority-high {
    border-left-color: #f97316;
}

.pending-drag-ghost.priority-urgent {
    border-left-color: #ef4444;
}

/* Drag Ghost — Job Type Color (Background + Text) */
.pending-drag-ghost.job-type-inspection {
    background: #d1fae5;
}

.pending-drag-ghost.job-type-inspection .ghost-title,
.pending-drag-ghost.job-type-inspection .ghost-time,
.pending-drag-ghost.job-type-inspection .ghost-type {
    color: #065f46;
}

.pending-drag-ghost.job-type-service {
    background: #dbeafe;
}

.pending-drag-ghost.job-type-service .ghost-title,
.pending-drag-ghost.job-type-service .ghost-time,
.pending-drag-ghost.job-type-service .ghost-type {
    color: #1e3a8a;
}

.ghost-time {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.ghost-title {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ghost-type {
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
}

/* ========================================
   Drop Preview (Landing Indicator)
   ======================================== */
.drop-preview {
    position: absolute;
    top: 6px;
    height: 48px;
    border-radius: 6px;
    background: rgba(5, 150, 105, 0.08);
    border: 2px dashed #059669;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drop-preview-time {
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    white-space: nowrap;
}

/* ========================================
   Job Preview (double-click a scheduled job card)
   ======================================== */
.job-preview {
    position: fixed;
    z-index: 10000;
    width: 240px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 12px 14px;
    font-size: 12px;
}

.job-preview-customer {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.job-preview-address {
    color: #475569;
    margin-bottom: 8px;
    line-height: 1.3;
}

.job-preview-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.job-preview-type {
    background: #f1f5f9;
    color: #334155;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.job-preview-priority {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: #ffffff;
    background: #64748b;
}

.job-preview-priority.priority-low { background: #3b82f6; }
.job-preview-priority.priority-medium { background: #f59e0b; }
.job-preview-priority.priority-high { background: #f97316; }
.job-preview-priority.priority-urgent { background: #ef4444; }

.job-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.job-preview-link {
    color: #059669;
    font-weight: 600;
    text-decoration: none;
}

.job-preview-link:hover {
    text-decoration: underline;
}

/* Multi-day placement badge in the popover: {EstimatedDays} / {DaysPlaced} + status pill. */
.job-preview-days {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.job-preview-days-ratio {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.job-preview-day-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}
