/* ─────────────────────────────────────────────────────────────────────────────
 * Fleet Optimiser — Styles (Railway standalone)
 *
 * Identical to WP version with body reset added.
 * ───────────────────────────────────────────────────────────────────────────── */

body {
    margin: 0;
    padding: 0;
    background: #f0f0f1;
}

* { box-sizing: border-box; }

#fo-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    color: #1d2327;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    background: #f0f0f1;
}

/* ── Card (date picker / loading / login) ────────────────────────────────── */

.fo-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    margin-top: 60px;
    animation: fo-fadeIn 0.2s ease-out;
}

.fo-card--center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

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

.fo-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1d2327;
}

.fo-subtitle {
    color: #646970;
    margin: 0 0 24px;
}

/* ── Form elements ─────────────────────────────────────────────────────────── */

.fo-form-group {
    margin-bottom: 20px;
}

.fo-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1d2327;
}

.fo-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
}

.fo-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.fo-input--compact {
    width: auto;
    padding: 6px 10px;
    font-size: 13px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.fo-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.fo-btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.15s, box-shadow 0.15s;
}

.fo-btn--primary {
    background: #2271b1;
    color: #fff;
    flex: 1;
}
.fo-btn--primary:hover { background: #135e96; }

.fo-btn--secondary {
    background: #f0f0f1;
    color: #2271b1;
    border: 1px solid #c3c4c7;
}
.fo-btn--secondary:hover { background: #dcdcde; }

/* ── Calendar icon button ─────────────────────────────────────────────────── */
.fo-btn--icon {
    padding: 4px 8px;
    font-size: 18px;
    line-height: 1;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    cursor: pointer;
    min-width: auto;
}
.fo-btn--icon:hover { background: #dcdcde; }

/* ── Logout button ─────────────────────────────────────────────────────────── */

.fo-btn--logout {
    background: transparent;
    color: #646970;
    border: 1px solid #c3c4c7;
    padding: 6px 14px;
    font-size: 12px;
}
.fo-btn--logout:hover { background: #f0f0f1; color: #d63638; border-color: #d63638; }

/* ── Loading spinner ───────────────────────────────────────────────────────── */

.fo-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #dcdcde;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: fo-spin 0.8s linear infinite;
}

@keyframes fo-spin { to { transform: rotate(360deg); } }

.fo-loading-text {
    color: #646970;
    margin: 0;
}

/* ── Error / Warning ───────────────────────────────────────────────────────── */

.fo-error {
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 4px;
    padding: 12px 16px;
    color: #8a0f0f;
    margin-bottom: 16px;
    font-size: 13px;
}

.fo-warning {
    background: #fcf9e8;
    border: 1px solid #dba617;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #6e4b00;
}

.fo-hint {
    color: #646970;
    font-size: 12px;
    margin: 4px 0 0;
}

/* ── Dashboard Layout ──────────────────────────────────────────────────────── */

.fo-dashboard { width: 100%; max-width: 1100px; animation: fo-fadeIn 0.2s ease-out; }
.fo-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.fo-header-left { display: flex; align-items: baseline; gap: 16px; }
.fo-header-left .fo-title { margin: 0; }
.fo-date-label { color: #646970; font-size: 15px; }
.fo-header-right { display: flex; align-items: center; gap: 8px; }

/* ── Summary Bar ───────────────────────────────────────────────────────────── */

.fo-summary { display: flex; gap: 24px; background: #fff; border: 1px solid #c3c4c7; border-radius: 8px; padding: 20px 28px; margin-bottom: 20px; flex-wrap: wrap; }
.fo-stat { display: flex; flex-direction: column; gap: 2px; }
.fo-stat-value { font-size: 20px; font-weight: 700; color: #1d2327; }
.fo-stat-value--large { font-size: 28px; color: #2271b1; }
.fo-stat-label { font-size: 12px; color: #646970; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Distance Source Chip ─────────────────────────────────────────────────── */

.fo-stat--source { margin-left: auto; }
.fo-source-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; white-space: nowrap; }
.fo-source-chip--google { background: #e8f5e9; color: #2e7d32; }
.fo-source-chip--haversine { background: #fff3e0; color: #e65100; }
.fo-source-chip--mixed { background: #e3f2fd; color: #1565c0; }

/* ── Group Toolbar ─────────────────────────────────────────────────────────── */

.fo-group-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.fo-group-label { font-size: 12px; font-weight: 600; color: #646970; }
.fo-group-btn { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 4px; border: 1px solid #c3c4c7; background: #fff; color: #646970; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.fo-group-btn:hover { background: #f8f9fa; border-color: #8c8f94; }
.fo-group-btn--active { background: #2271b1; border-color: #2271b1; color: #fff; }
.fo-group-btn--active:hover { background: #135e96; border-color: #135e96; }

/* ── Grouped List ──────────────────────────────────────────────────────────── */

.fo-grouped-list { display: flex; flex-direction: column; gap: 20px; }
.fo-group-section { display: flex; flex-direction: column; gap: 8px; }
.fo-group-header { display: flex; align-items: center; gap: 12px; padding: 8px 0 4px; border-bottom: 2px solid #2271b1; }
.fo-group-name { font-size: 15px; font-weight: 700; color: #1d2327; }
.fo-group-count { font-size: 12px; color: #646970; background: #f0f0f1; padding: 2px 8px; border-radius: 3px; font-weight: 600; }
.fo-group-km { font-size: 12px; font-weight: 600; color: #646970; margin-left: auto; }

/* ── Truck Cards ───────────────────────────────────────────────────────────── */

.fo-truck-list { display: flex; flex-direction: column; gap: 8px; }
.fo-truck-card { background: #fff; border: 1px solid #c3c4c7; border-radius: 8px; overflow: hidden; transition: box-shadow 0.15s; }
.fo-truck-card--expanded { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.fo-truck-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; cursor: pointer; user-select: none; transition: background 0.1s; }
.fo-truck-header:hover { background: #f8f9fa; }
.fo-truck-info { display: flex; align-items: center; gap: 12px; }
.fo-truck-name { font-weight: 600; font-size: 14px; }
.fo-truck-cat { background: #f0f0f1; color: #646970; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; }
.fo-truck-jobs { color: #646970; font-size: 13px; }
.fo-truck-deadhead { display: flex; align-items: center; gap: 10px; }
.fo-total-km { font-size: 12px; color: #646970; white-space: nowrap; }
.fo-expand-icon { color: #8c8f94; font-size: 11px; }

/* ── KM Badges (severity) ─────────────────────────────────────────────────── */

.fo-km-badge { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 12px; white-space: nowrap; }
.fo-km-badge--green { background: #edfaef; color: #1e7e34; }
.fo-km-badge--yellow { background: #fcf9e8; color: #9a6700; }
.fo-km-badge--orange { background: #fff3e0; color: #c45000; }
.fo-km-badge--red { background: #fcf0f1; color: #cc1818; }

/* ── Truck Detail ──────────────────────────────────────────────────────────── */

.fo-truck-detail { border-top: 1px solid #e8e8e8; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }

/* ── Job Row ───────────────────────────────────────────────────────────────── */

.fo-job-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
.fo-round-badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #2271b1; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.fo-job-info { flex: 1; min-width: 0; }
.fo-job-route { font-size: 14px; font-weight: 500; }
.fo-suburb { color: #1d2327; }
.fo-suburb--delivery { font-weight: 600; }
.fo-arrow { color: #8c8f94; }
.fo-job-meta { display: flex; gap: 12px; font-size: 12px; color: #646970; margin-top: 2px; }
.fo-customer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.fo-so { color: #8c8f94; }

/* ── Deadhead Leg ──────────────────────────────────────────────────────────── */

.fo-deadhead-leg { display: flex; align-items: center; gap: 8px; padding: 4px 0 4px 16px; font-size: 12px; border-left: 2px dashed #dcdcde; margin-left: 15px; }
.fo-deadhead-leg--green  { border-left-color: #1e7e34; color: #1e7e34; }
.fo-deadhead-leg--yellow { border-left-color: #9a6700; color: #9a6700; }
.fo-deadhead-leg--orange { border-left-color: #c45000; color: #c45000; }
.fo-deadhead-leg--red    { border-left-color: #cc1818; color: #cc1818; }
.fo-leg-icon { font-size: 14px; opacity: 0.6; }
.fo-leg-text { flex: 1; }
.fo-leg-km { font-weight: 600; white-space: nowrap; }

/* ── Swap Suggestions ─────────────────────────────────────────────────────── */

.fo-swaps-bar { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid #c3c4c7; border-radius: 8px; padding: 16px 20px; margin-bottom: 20px; }
.fo-swaps-bar--loading { gap: 12px; }
.fo-btn--swap { background: #1e7e34; color: #fff; white-space: nowrap; }
.fo-btn--swap:hover { background: #196b2c; }
.fo-swaps-hint { color: #646970; font-size: 13px; }
.fo-spinner--small { width: 24px; height: 24px; border-width: 3px; flex-shrink: 0; }
.fo-swaps-result { margin-bottom: 20px; }
.fo-swaps-result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 12px; }
.fo-section-title { font-size: 18px; font-weight: 600; margin: 0; color: #1d2327; }
.fo-swaps-result-stats { display: flex; align-items: center; gap: 12px; }
.fo-km-badge--large { font-size: 16px; padding: 6px 14px; }
.fo-swaps-meta { color: #646970; font-size: 12px; }
.fo-swaps-empty { background: #fff; border: 1px solid #c3c4c7; border-radius: 8px; padding: 24px; text-align: center; color: #646970; }
.fo-swaps-empty p { margin: 4px 0; }
.fo-swaps-list { display: flex; flex-direction: column; gap: 10px; }

/* ── Swap Card ──────────────────────────────────────────────────────────────── */

.fo-swap-card { background: #fff; border: 1px solid #c3c4c7; border-left: 4px solid #1e7e34; border-radius: 8px; overflow: hidden; }
.fo-swap-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: #f8faf8; border-bottom: 1px solid #e8e8e8; }
.fo-swap-rank { font-size: 16px; font-weight: 700; color: #1e7e34; min-width: 28px; }
.fo-swap-round { font-size: 13px; font-weight: 600; color: #646970; background: #f0f0f1; padding: 2px 10px; border-radius: 3px; }
.fo-swap-body { display: flex; align-items: stretch; padding: 16px 20px; gap: 0; }
.fo-swap-truck { flex: 1; min-width: 0; }
.fo-swap-arrow { display: flex; align-items: center; justify-content: center; width: 48px; flex-shrink: 0; font-size: 24px; color: #8c8f94; }
.fo-swap-truck-name { font-weight: 600; font-size: 14px; margin-bottom: 8px; color: #1d2327; }
.fo-swap-job { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.fo-swap-label { font-weight: 600; color: #646970; font-size: 11px; text-transform: uppercase; min-width: 40px; }
.fo-swap-job--current .fo-swap-route { color: #646970; }
.fo-swap-job--swapped .fo-swap-route { color: #1e7e34; font-weight: 500; }
.fo-swap-route { font-size: 13px; }
.fo-swap-km-change { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #646970; margin-top: 6px; padding-top: 6px; border-top: 1px solid #f0f0f1; }
.fo-swap-diff { font-weight: 700; font-size: 12px; }
.fo-diff--better { color: #1e7e34; }
.fo-diff--worse  { color: #cc1818; }
.fo-diff--neutral { color: #646970; }
.fo-swap-summary { padding: 10px 20px; background: #f8faf8; border-top: 1px solid #e8e8e8; font-size: 13px; color: #646970; }
.fo-swap-summary-text { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fo-swap-before { text-decoration: line-through; color: #8c8f94; }
.fo-swap-after { font-weight: 700; color: #1e7e34; }

/* ── Yard Badges ──────────────────────────────────────────────────────────── */

.fo-garage-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 3px; background: #fff3e0; color: #e65100; white-space: nowrap; }
.fo-yard-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.3px; }
.fo-yard-badge--north { background: #e0f2f1; color: #00695c; }
.fo-yard-badge--darra { background: #f0f0f1; color: #646970; }
.fo-yard-badge--mixed { background: #e3f2fd; color: #1565c0; }
.fo-yard-saving { font-size: 11px; color: #1e7e34; font-weight: 600; white-space: nowrap; }

/* ── Yard Pills ───────────────────────────────────────────────────────────── */

.fo-yard-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 3px; margin-right: 4px; }
.fo-yard-pill--north { background: #e0f2f1; color: #00695c; }
.fo-yard-pill--darra { background: #f0f0f1; color: #646970; }
.fo-yard-pill--mixed { background: #e3f2fd; color: #1565c0; }

/* ── Yard Toggle ──────────────────────────────────────────────────────────── */

.fo-yard-toggle-bar { display: flex; align-items: center; gap: 8px; padding: 10px 0; margin-bottom: 4px; border-bottom: 1px solid #f0f0f1; }
.fo-yard-toggle-label { font-size: 12px; font-weight: 600; color: #646970; }
.fo-yard-toggle-btn { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 4px; border: 1px solid #c3c4c7; background: #fff; color: #646970; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.fo-yard-toggle-btn:hover { background: #f8f9fa; border-color: #8c8f94; }
.fo-yard-toggle-btn--active { background: #2271b1; border-color: #2271b1; color: #fff; }
.fo-yard-toggle-btn--active:hover { background: #135e96; border-color: #135e96; }
.fo-yard-toggle-btn--north.fo-yard-toggle-btn--active { background: #00695c; border-color: #00695c; }
.fo-yard-toggle-btn--north.fo-yard-toggle-btn--active:hover { background: #004d40; border-color: #004d40; }
.fo-yard-toggle-btn--optimal.fo-yard-toggle-btn--active { background: #1565c0; border-color: #1565c0; }
.fo-yard-toggle-btn--optimal.fo-yard-toggle-btn--active:hover { background: #0d47a1; border-color: #0d47a1; }
.fo-yard-toggle-btn--custom.fo-yard-toggle-btn--active { background: #7b1fa2; border-color: #7b1fa2; color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.fo-yard-toggle-btn--custom.fo-yard-toggle-btn--active:hover { background: #6a1b9a; border-color: #6a1b9a; }
.fo-yard-reset { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); font-size: 10px; line-height: 1; cursor: pointer; transition: background 0.15s; }
.fo-yard-reset:hover { background: rgba(255, 255, 255, 0.45); }
.fo-yard-saving-inline { font-size: 11px; color: #1e7e34; font-weight: 600; margin-left: auto; }

/* ── Job Type Badge ───────────────────────────────────────────────────────── */

.fo-job-type-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.3px; margin-left: 6px; vertical-align: middle; }
.fo-job-type-badge--purchase { background: #e8eaf6; color: #283593; }

/* ── Per-Round Yard Pills ─────────────────────────────────────────────────── */

.fo-round-legs { display: flex; flex-direction: column; gap: 4px; }
.fo-job-round { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fo-round-yard-pill { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 3px; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.fo-round-yard-pill--darra { background: #f0f0f1; color: #646970; }
.fo-round-yard-pill--north { background: #e0f2f1; color: #00695c; }
.fo-round-yard-pill--vendor { background: #e8eaf6; color: #283593; }
.fo-round-yard-pill--clickable { cursor: pointer; transition: filter 0.15s, box-shadow 0.15s; }
.fo-round-yard-pill--clickable:hover { filter: brightness(0.9); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15); }
.fo-round-yard-pill--override { box-shadow: 0 0 0 2px #7b1fa2; }
.fo-round-yard-pill--override:hover { box-shadow: 0 0 0 2px #7b1fa2, 0 0 4px rgba(123, 31, 162, 0.3); }
.fo-leg-yard-pill { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 3px; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.fo-leg-yard-pill--darra { background: #f0f0f1; color: #646970; }
.fo-leg-yard-pill--north { background: #e0f2f1; color: #00695c; }
.fo-yard-sequence { font-family: monospace; font-size: 12px; font-weight: 600; padding: 1px 4px; background: #f0f0f1; border-radius: 3px; letter-spacing: 2px; }

/* ── Yard-Aware Swap Cards ────────────────────────────────────────────────── */

.fo-swap-card--yard { border-left-color: #00897b; }
.fo-swap-header--yard { background: #f0faf8; }
.fo-swap-card--yard .fo-swap-rank { color: #00695c; }
.fo-swap-type-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 3px; background: #e0f2f1; color: #00695c; text-transform: uppercase; letter-spacing: 0.3px; }
.fo-yard-impact { padding: 10px 20px; background: #f0faf8; border-top: 1px solid #e0f2f1; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.fo-yard-impact-label { font-size: 11px; font-weight: 700; color: #00695c; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.fo-yard-impact-items { display: flex; flex-wrap: wrap; gap: 12px; }
.fo-yard-change { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #1d2327; }

/* ── Swap Apply Action ────────────────────────────────────────────────────── */

.fo-swap-action { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-top: 1px solid #e8e8e8; background: #fafafa; }
.fo-swap-action--loading { background: #f8f9fa; }
.fo-swap-action--success { background: #f0faf0; flex-direction: column; align-items: flex-start; gap: 4px; }
.fo-swap-action--error { background: #fcf0f1; }
.fo-btn--apply { padding: 6px 16px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; font-family: inherit; background: #2271b1; color: #fff; transition: background 0.15s; white-space: nowrap; }
.fo-btn--apply:hover { background: #135e96; }

/* ── Deploy Button ────────────────────────────────────────────────────────── */

.fo-btn--deploy { padding: 6px 16px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; font-family: inherit; background: #1e7e34; color: #fff; transition: background 0.15s; white-space: nowrap; }
.fo-btn--deploy:hover { background: #196b2c; }
.fo-btn--deploy-sm { padding: 4px 12px; font-size: 12px; margin-left: auto; }

/* ── Deploy Status ────────────────────────────────────────────────────────── */

.fo-deploy-status { font-size: 12px; color: #646970; }
.fo-deploy-status--success { color: #1e7e34; font-weight: 600; }
.fo-deploy-status--error { color: #cc1818; font-weight: 600; }
.fo-deploy-status--warning { color: #9a6700; font-size: 11px; }
.fo-deploy-status--info { color: #646970; font-size: 11px; font-style: italic; }
.fo-deploy-inline { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.fo-deploy-inline-msg { margin-left: auto; }

/* ── Per-Round Deploy Icon ────────────────────────────────────────────────── */

.fo-round-deploy { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 3px; font-size: 10px; font-weight: 700; color: #8c8f94; cursor: pointer; transition: color 0.15s, background 0.15s; }
.fo-round-deploy:hover { color: #1e7e34; background: #edfaef; }
.fo-round-deploy--loading { color: #646970; cursor: default; }
.fo-round-deploy--done { color: #1e7e34; cursor: default; }

/* ── Transfer Window Badges ───────────────────────────────────────────────── */

.fo-transfer-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; background: #fce4ec; color: #c62828; white-space: nowrap; margin-left: 6px; letter-spacing: 0.3px; }
.fo-deadhead-leg--transfer { background: #fce4ec22; border-left-color: #c62828 !important; color: #c62828 !important; }
.fo-stat--transfer .fo-stat-value { color: #c62828; }
.fo-transfer-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; margin-right: 4px; }
.fo-transfer-pill--stn { background: #fce4ec; color: #c62828; }
.fo-transfer-pill--nts { background: #e8eaf6; color: #283593; }

/* ── Job State Badges ─────────────────────────────────────────────────────── */

.fo-state-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.3px; margin-left: 6px; vertical-align: middle; }
.fo-state-badge--in-progress { background: #fff3e0; color: #e65100; }
.fo-state-badge--done { background: #edfaef; color: #1e7e34; }
.fo-state-badge--draft { background: #f0f0f1; color: #8c8f94; }
.fo-state-badge--cancel { background: #fcf0f1; color: #cc1818; }
.fo-job-row--cancelled { opacity: 0.5; }
.fo-job-row--cancelled .fo-job-route { text-decoration: line-through; }

/* ── Historical / Past Date ───────────────────────────────────────────────── */

.fo-past-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 3px; background: #fff3e0; color: #9a6700; text-transform: uppercase; letter-spacing: 0.3px; }
.fo-btn--swap-past { background: #9a6700; color: #fff; white-space: nowrap; }
.fo-btn--swap-past:hover { background: #7c5300; }
.fo-swaps-bar--past { background: #fffbf0; border-color: #dba617; }
.fo-swap-action--locked { background: #f8f9fa; color: #8c8f94; font-size: 12px; font-style: italic; padding: 10px 20px; border-top: 1px solid #e8e8e8; }

/* ── Draft Card Section ───────────────────────────────────────────────────── */

.fo-draft-section { margin-top: 8px; padding-top: 8px; border-top: 2px dashed #dcdcde; }
.fo-draft-header { font-size: 11px; font-weight: 600; color: #8c8f94; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.fo-job-row--draft { opacity: 0.6; }
.fo-round-badge--draft { background: #dcdcde; color: #8c8f94; }
.fo-draft-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.3px; margin-left: 6px; vertical-align: middle; }
.fo-draft-badge--open { background: #edfaef; color: #1e7e34; }
.fo-draft-badge--soft-booking { background: #fff3e0; color: #e65100; }
.fo-draft-badge--closed { background: #fcf0f1; color: #cc1818; }
.fo-draft-badge--draft { background: #f0f0f1; color: #8c8f94; }
.fo-draft-badge--cancel { background: #fcf0f1; color: #cc1818; }
.fo-draft-badge--restriction { background: #f3e8ff; color: #6b21a8; font-size: 9px; }
.fo-draft-badge--loading { opacity: 0.5; animation: fo-pulse 1.2s ease-in-out infinite; }
@keyframes fo-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.7; } }
.fo-draft-spinner { font-size: 10px; color: #646970; font-weight: 400; animation: fo-pulse 1.2s ease-in-out infinite; }

/* ── Empty State ───────────────────────────────────────────────────────────── */

.fo-empty { background: #fff; border: 1px solid #c3c4c7; border-radius: 8px; padding: 40px; text-align: center; color: #646970; }
.fo-empty p { margin: 4px 0; }

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    #fo-app { padding: 12px; }
    .fo-summary { flex-direction: column; gap: 12px; padding: 16px; }
    .fo-stat { flex-direction: row; justify-content: space-between; align-items: center; }
    .fo-header { flex-direction: column; align-items: flex-start; }
    .fo-truck-info { flex-wrap: wrap; }
    .fo-job-meta { flex-direction: column; gap: 2px; }
    .fo-swap-body { flex-direction: column; gap: 0; }
    .fo-swap-arrow { width: auto; height: 32px; font-size: 20px; transform: rotate(90deg); }
    .fo-swaps-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
}
