﻿/* Routing Workbench.
 *
 * Two columns: the pending pool on the left, the plan and the unplaced list on the right.
 * The plan column is wider because a route carries far more per row than a pending job does.
 */

.workbench-columns {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 16px;
    flex-wrap: wrap;
}

.workbench-column {
    flex: 1;
    min-width: 280px;
}

.workbench-column-wide {
    flex: 2;
    min-width: 420px;
}

.workbench-heading {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.workbench-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.workbench-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    background: #e2e8f0;
    border-radius: 10px;
}

.workbench-badge-warn {
    color: #92400e;
    background: #fef3c7;
}

.workbench-list {
    max-height: 620px;
    overflow-y: auto;
}

.workbench-empty {
    padding: 28px 16px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}

.workbench-empty-icon {
    display: block;
    margin-bottom: 10px;
    font-size: 26px;
    color: #cbd5e1;
}

.workbench-empty-sub {
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.workbench-heading-sub {
    margin-top: 18px;
    font-size: 13px;
    color: #92400e;
}

/* ---- cards ---- */

.workbench-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left-width: 3px;
    border-radius: 8px;
}

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

.workbench-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.workbench-card-sub {
    font-size: 12px;
    color: #64748b;
}

.workbench-job-link {
    color: #3b82f6;
    text-decoration: none;
}

.workbench-job-link:hover {
    text-decoration: underline;
}

.workbench-card-pinned {
    border-left-color: #3b82f6;
}

.workbench-card-unplaced {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.workbench-card-ok {
    border-left-color: #059669;
}

.workbench-reason {
    font-weight: 600;
    color: #b45309;
}

.workbench-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
}

.workbench-pin-badge {
    color: #3b82f6;
}

/* ---- a technician-day ---- */

.workbench-day {
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.workbench-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.workbench-day-date {
    margin-left: 8px;
    font-size: 13px;
    color: #64748b;
}

.workbench-day-stats {
    font-size: 12px;
    color: #475569;
}

/* The return leg is called out rather than folded into the total, because it is the figure
 * most likely to be assumed absent -- and its absence is what biases a router into pushing
 * the last job of the day as far from home as possible. */
.workbench-return {
    color: #64748b;
    font-style: italic;
}

.workbench-day-stops {
    padding: 6px 0;
}

.workbench-stop {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 12px;
}

.workbench-seq {
    flex: 0 0 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background: #3b82f6;
    border-radius: 50%;
}

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

.workbench-stop-title {
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
}

.workbench-stop-sub {
    font-size: 12px;
    color: #64748b;
}

.workbench-provenance {
    color: #475569;
}

/* Already on the calendar. The engine may never move these -- greyed so a dispatcher does not
 * try to drag one and wonder why nothing happens. */
.workbench-stop-existing {
    background: #f8fafc;
}

.workbench-stop-existing .workbench-seq {
    background: #94a3b8;
}

.workbench-stop-pinned .workbench-seq {
    background: #0f172a;
}

.workbench-overdue,
.workbench-existing {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.workbench-overdue {
    color: #991b1b;
    background: #fee2e2;
}

.workbench-existing {
    color: #475569;
    background: #e2e8f0;
}

.workbench-pin {
    color: #94a3b8;
    padding: 2px 4px;
}

.workbench-pin:hover {
    color: #3b82f6;
}

/* ---- savings ---- */

.workbench-savings {
    margin-top: 16px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.workbench-savings-grid {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.workbench-stat {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.workbench-stat-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.workbench-savings-note {
    margin-top: 10px;
    font-size: 12px;
    color: #475569;
}

/* ---- publish report ---- */

.workbench-report {
    margin-top: 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

/* ---- toolbar ----
 *
 * ONE card holding both setup rows. This was three stacked full-width sections - instructions,
 * filters, session controls - which together consumed roughly 580px before a single job was
 * visible. The instructions moved into a modal; the other two are the same step and had no
 * reason to be separate boxes.
 */

.workbench-toolbar {
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
    position: relative;
}

.workbench-toolbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* A hairline between "what to route" and "how to route it" - the two rows are related enough
 * to share a card and distinct enough to need separating. */
.workbench-toolbar-settings {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    align-items: flex-end;
}

.workbench-search {
    flex: 1 1 260px;
    min-width: 220px;
}

.workbench-filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Just an icon. A full "How this works" button competed with the filters for attention every
 * visit, and the content behind it is only needed once. */
.workbench-help-link {
    border: none;
    background: none;
    padding: 6px 4px;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.workbench-help-link:hover {
    color: #3b82f6;
}

.workbench-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.workbench-field-narrow {
    min-width: 120px;
    max-width: 140px;
}

.workbench-field label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Pushed to the far end so the primary action is never lost among the settings. */
.workbench-solve {
    margin-left: auto;
    align-self: flex-end;
}

.workbench-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.workbench-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.workbench-alert {
    margin-bottom: 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: #991b1b;
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    border-radius: 6px;
}

/* ---- help modal ---- */

.workbench-help-steps {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
}

.workbench-help-steps li {
    margin-bottom: 12px;
}

.workbench-help-steps strong {
    color: #0f172a;
}

.workbench-help-steps em {
    font-style: normal;
    font-weight: 600;
    color: #334155;
}

/* Existing scheduled work is the one thing on this screen that behaves differently from
 * everything else, so it is called out rather than left to be discovered. */
.workbench-help-note {
    margin-top: 4px;
    padding: 10px 12px;
    font-size: 13px;
    color: #92400e;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
}
