/* Office screens other than the schedule board: the live dashboard, cancelled jobs, POD buttons, history, terms. */

/* the live dashboard ("In progress now") */
.live-dash { background: var(--bg); }
.live-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.live-title { display: none; font-size: 22px; }
.live-clock { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.live-group { margin-bottom: 18px; }
.live-group h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text); margin-bottom: 6px; }
.live-group h3 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.live-card { --live-c: var(--stage-allocated, #2552a4); display: grid; grid-template-columns: 190px minmax(0, 1.1fr) minmax(0, 2fr) 260px; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--live-c); padding: 8px 12px; margin-bottom: 6px; }
.live-card[data-stage="accepted"] { --live-c: var(--stage-accepted, #5b3fb5); }
.live-card[data-stage="to-pickup"] { --live-c: var(--stage-to-pickup, #0e7490); }
.live-card[data-stage="at-pickup"] { --live-c: var(--stage-at-pickup, #b85f0c); }
.live-card[data-stage="to-delivery"] { --live-c: var(--stage-to-delivery, #1d6fa5); }
.live-card[data-stage="at-delivery"] { --live-c: var(--stage-at-delivery, #8a4b0b); }
.live-card[data-stage="delivered"] { --live-c: var(--stage-delivered, #17734a); }
.live-card.attention { border-color: var(--stage-warning, #b42318); border-left-color: var(--stage-warning, #b42318); background: color-mix(in srgb, var(--stage-warning, #b42318) 5%, var(--surface)); }
.live-card .step.done { background: color-mix(in srgb, var(--live-c) 12%, var(--surface)); border-color: var(--live-c); color: var(--live-c); }
.live-card .step.now { background: var(--live-c); border-color: var(--live-c); color: #fff; }
.live-card > * { min-width: 0; }
.live-stage { display: block; }
.live-speed { margin-top: 4px; }
.live-speed-num { font-size: 2rem; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-speed-cap { font-size: 11px; }
.live-speed.old .live-speed-num { color: var(--muted); font-weight: 600; }
.live-eta { margin-top: 2px; }
.place-dialog { width: min(560px, 94vw); max-width: 94vw; padding: 14px; }
.place-text { font-weight: 600; word-break: break-word; }
.place-view { height: 340px; min-height: 0; touch-action: none; margin: 8px 0; }
.place-pin { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.place-pin::before { content: ""; position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--nf-orange); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(16, 24, 40, .6); box-sizing: border-box; }
.place-pin[hidden] { display: none; }
.overdue-flag { display: inline-block; background: var(--stage-warning, #b42318); color: #fff; font-weight: 700; padding: 1px 8px; border-radius: 3px; margin-bottom: 3px; }
.dem-flag { color: var(--stage-warning, #b42318); font-weight: 600; }
.live-idle, .live-foot { margin-top: 8px; }
.live-bar .warn { font-weight: 600; }

/* full screen: the dashboard alone, bigger type */
.live-dash.live-full { position: fixed; inset: 0; z-index: 300; overflow: auto; padding: 20px 28px; font-size: 17px; }
.live-dash:fullscreen { overflow: auto; padding: 20px 28px; font-size: 17px; background: var(--bg); }
.live-full .live-title { display: block; }
.live-full .live-clock { font-size: 30px; }
.live-full .live-card { grid-template-columns: 260px minmax(0, 1.1fr) minmax(0, 2fr) 320px; padding: 12px 16px; }
.live-full .step { font-size: 13px; padding: 7px 2px; }
.live-full .live-driver { font-size: 20px; }
.live-full .live-speed-num { font-size: 3.2rem; }
.live-full .live-speed-cap { font-size: 14px; }
.live-full .live-group h3 { font-size: 14px; }
.live-full .conlink { color: var(--text); pointer-events: none; }
@media (max-width: 1100px) { .live-card { grid-template-columns: 1fr; gap: 8px; } }

/* cancelled jobs and what FMS says */
.callout.cancelled { background: var(--danger-soft); border-left-color: var(--danger); }
.fmsfacts { margin-top: 12px; }
tr.cancelled-row td { color: var(--muted); }
.fmsfacts .label { margin-bottom: 2px; }

/* proof of delivery buttons, times */
.podbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.five { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.five .timebox strong { font-size: 16px; }
.dem-note { font-weight: 600; margin: 0 0 6px; }

/* forms */
label .help { font-weight: 400; font-size: 11px; }

/* a driver's history */
.history-dialog { width: min(820px, 94vw); max-height: 86vh; }
.history-dialog .tbl { margin-top: 4px; }

/* help */
.help-page { max-width: 820px; }
.help-search { width: 100%; max-width: 420px; margin: 4px 0 8px; }
.help-section h3 { margin: 22px 0 8px; font-size: 15px; }
.help-item { background: #fff; border: 1px solid #dfe3ea; border-radius: 6px; margin-bottom: 6px; }
.help-item summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.help-item[open] summary { border-bottom: 1px solid #eef0f4; }
.help-answer { padding: 4px 14px 10px; line-height: 1.5; }
.help-answer p { margin: 8px 0; }
.help-answer ul { margin: 8px 0; padding-left: 20px; }
.help-answer li { margin: 4px 0; }

/* terms we use */
.terms-page { max-width: 760px; }
.terms dt { font-weight: 600; font-size: 14px; margin-top: 16px; }
.terms dd { margin: 4px 0 0; line-height: 1.5; }

/* Staff page and the View only tag */
.who .etag.viewonly { margin-left: 8px; vertical-align: 1px; }
.dialog.wide label.check { margin-top: 4px; }
.dialog.wide h3 + .muted { margin-top: -6px; }

/* the Map tab: a list on the left and the tile map on the right (stacked on narrow screens) */
.map-page { display: flex; flex-direction: column; }
.map-wrap { flex: 1; min-height: 420px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; }
.map-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.map-rows { overflow: auto; flex: 1; border: 1px solid var(--line); background: var(--surface); }
.map-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; font: inherit; cursor: pointer; }
.map-row:hover, .map-row.picked { background: var(--nf-blue-soft); }
.map-rowtext { display: flex; flex-direction: column; min-width: 0; font-size: 12px; }
.map-rowtext strong { font-size: 13px; }
.map-swatch { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: none; background: var(--muted); }
.map-swatch[data-state="moving"], .map-dot[data-state="moving"]::before { background: var(--ok); }
.map-swatch[data-state="stopped"], .map-dot[data-state="stopped"]::before { background: var(--nf-blue); }
.map-view { position: relative; overflow: hidden; border: 1px solid var(--line-strong); background: #dfe5ec; touch-action: none; cursor: grab; min-height: 420px; user-select: none; }
.map-view.dragging { cursor: grabbing; }
.map-tiles, .map-marks { position: absolute; inset: 0; }
.map-marks { pointer-events: none; }
.map-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; }
.map-dot { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; font: inherit; }
.map-dot::before { content: ""; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .45); box-sizing: border-box; }
.map-dot.picked::before { outline: 2px solid var(--nf-orange); outline-offset: 1px; }
.map-avg { font-weight: 600; color: var(--brand, #2552A4); white-space: nowrap; }
.map-label { position: absolute; left: 10px; top: -9px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 4px; font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--text); }
.map-arrow { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; }
.map-arrow::after { content: ""; position: absolute; left: 0; top: -15px; border: 5px solid transparent; border-bottom: 9px solid var(--ok); border-top: 0; }
.map-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.map-attrib { position: absolute; right: 0; bottom: 0; background: rgba(255, 255, 255, .85); font-size: 11px; padding: 1px 6px; }
.map-panel { position: absolute; left: 10px; bottom: 22px; width: 300px; max-width: calc(100% - 20px); background: var(--surface); border: 1px solid var(--line-strong); border-top: 3px solid var(--nf-blue); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(16, 24, 40, .2); padding: 10px 12px; cursor: default; user-select: text; }
.map-panel[hidden] { display: none; }
.map-close { position: absolute; right: 6px; top: 6px; }
.map-fact { display: flex; flex-direction: column; margin-top: 6px; font-size: 13px; }
@media (max-width: 800px) { .map-wrap { grid-template-columns: 1fr; grid-template-rows: auto minmax(380px, 1fr); } .map-rows { max-height: 220px; } .map-view { min-height: 380px; } }
.conn-card { background: var(--surface); border: 1px solid var(--line-strong); border-top: 3px solid var(--nf-blue); border-radius: var(--radius); padding: 14px 16px; max-width: 640px; }
.conn-card h3 { margin-bottom: 10px; font-size: 15px; }
.conn-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin-bottom: 12px; }
.conn-facts dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.conn-facts dd { margin: 0; }
.conn-card input { min-width: 220px; }
.conn-result { margin: 4px 0 8px; padding: 6px 10px; border-left: 3px solid var(--nf-blue); background: var(--nf-blue-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.conn-result.warn { border-left-color: var(--nf-orange); background: var(--warn-soft); }

.map-route { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.map-route polyline { fill: none; stroke: var(--nf-orange); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.fd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fd-table th, .fd-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.fd-list-card { max-width: none; margin-top: 16px; }
.fd-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.fd-unmatched { margin: 8px 0 12px; }
.fd-unmatched li { margin: 4px 0; }

/* Reporting tab */
.rep-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.rep-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 14px; }
.rep-group h3 { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 4px; }
.rep-link { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-left: 3px solid transparent; padding: 6px 10px; font-weight: 600; color: var(--text); }
.rep-link:hover { background: var(--nf-blue-soft); }
.rep-link.on { border-left-color: var(--nf-blue); background: var(--nf-blue-soft); color: var(--nf-blue); }
.rep-head { align-items: flex-start; }
.rep-head h2 { margin-bottom: 2px; }
.rep-about { margin: 0 0 8px; }
.rep-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rep-updated { font-size: 12px; }
.rep-quick { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rep-filterbox { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.rep-filterbox label { margin-bottom: 0; }
.rep-printhead { display: none; }
.rep-body.busy { opacity: .55; }
.rep-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.rep-tile { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--nf-blue); border-radius: var(--radius); padding: 8px 12px; }
.rep-tile strong { font-size: 22px; line-height: 1.2; }
.rep-chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.rep-chart h3, .rep-section h3 { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.rep-bar { display: grid; grid-template-columns: minmax(120px, 240px) minmax(0, 1fr) 80px; gap: 10px; align-items: center; padding: 2px 0; }
.rep-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-bar-track { background: var(--surface-2); border-radius: 2px; height: 14px; overflow: hidden; }
.rep-bar-fill { display: block; height: 100%; background: var(--nf-blue); }
.rep-bar-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.rep-section { margin-top: 20px; }
.rep-tablewrap { overflow-x: auto; }
.rep-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.rep-sort:hover { color: var(--nf-blue); }
.rep-table .num { text-align: right; }
.rep-gap { color: var(--danger); font-weight: 600; }
.rep-notes { margin-top: 16px; padding-left: 18px; font-size: 12px; }
@media (max-width: 800px) { .rep-layout { grid-template-columns: minmax(0, 1fr); } .rep-nav { position: static; } }
@media print {
  body { display: block; height: auto; overflow: visible; background: #fff; font-size: 11px; }
  .top, .alertbar, .detail, .env-banner, #toast, .rep-nav, .rep-filters, .rep-actions, .rep-head p, .rep-quick { display: none !important; }
  .app, main, .page, .rep-layout { display: block; height: auto; overflow: visible; padding: 0; }
  .rep-head h2 { display: none; }
  .rep-printhead { display: block; font-size: 15px; margin-bottom: 10px; }
  .rep-tile, .rep-chart, .tbl { break-inside: avoid; box-shadow: none; }
  .tbl tr { break-inside: avoid; }
  .rep-bar-fill { background: #555; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rep-sort { color: inherit; }
}
