/* Vehicle Management: status list, vehicle list grid and history. */
#vehicles-status, #vehicles-list, #vehicles-details { display: grid; gap: 12px; }
.veh-bar input { flex-basis: 100%; }
.staff-bar.veh-bar select { flex: 1 1 6rem; min-width: 0; }
@media (min-width: 768px) {
    .veh-bar input { flex-basis: 12rem; }
    .staff-bar.veh-bar select { flex: 0 1 9rem; }
}
.staff-bar.veh-bar { max-width: 56rem; }
.veh-refresh { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.veh-refresh[hidden] { display: none; }
.veh-refresh .note { margin: 0; font-size: 0.8rem; white-space: nowrap; }
.weighed-tabs .veh-refresh button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--primary); cursor: pointer; }
.weighed-tabs .veh-refresh button:hover { background: var(--nav-active); }
.weighed-tabs .veh-refresh button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.veh-refresh button.spinning svg { animation: app-spin 0.8s linear infinite; }
.veh-summary { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--nav-active); font-size: 0.875rem; font-weight: 500; }
.veh-reg { font-size: 1.05rem; letter-spacing: 0.04em; }
.veh-since { margin: 0; font-size: 0.85rem; overflow-wrap: anywhere; }

/* Coloured text instead of bubbles. */
.veh-text { font-weight: 600; font-size: 0.9rem; }
.veh-good { color: hsl(142, 70%, 30%); }
.veh-bad { color: var(--danger); }
.veh-warn { color: hsl(30, 90%, 38%); }
.veh-info { color: var(--primary); }
.veh-muted { color: var(--muted); font-weight: 500; }
html[data-theme="dark"] .veh-good { color: hsl(142, 65%, 60%); }
html[data-theme="dark"] .veh-warn { color: hsl(38, 90%, 62%); }

/* Vehicle status: one row per vehicle, options open underneath. */
.vst-row { cursor: pointer; }
.vst-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.vst-actions .sign-out, .vst-actions .primary { width: auto; height: 36px; padding: 0 14px; }
.vst-actions button:disabled { opacity: 0.35; cursor: not-allowed; }
.vst-detail { grid-template-columns: minmax(0, 1fr); }
.vst-form { display: grid; gap: 10px; }
.vst-form h4, .vst-form .note { margin: 0; }
.vst-note { display: flex; gap: 6px; width: 100%; min-width: 0; }
.vst-note input { flex: 1 1 0; width: 1px; min-width: 0; }
.vst-note .sign-out { flex: 0 0 auto; width: auto; height: auto; padding: 0 12px; }

.veh-fixed { display: block; padding: 10px 0; color: var(--muted); }
.veh-history { display: grid; gap: 16px; margin-top: 8px; }
.veh-section { display: grid; gap: 8px; }
.veh-section > .sign-out { justify-self: start; height: 36px; padding: 0 14px; width: auto; }
.veh-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.veh-notes { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.veh-done { opacity: 0.65; }
#vehicles-details textarea { width: 100%; font-size: 16px; }

@media (max-width: 767px) {
    .veh-grid .staff-meta span + span::before,
    .vst-grid .staff-meta span + span::before { content: "· "; }
    .veh-grid .data-row .sign-out { justify-self: start; height: 36px; padding: 0 14px; }
    .vst-actions { flex-wrap: nowrap; }
    .vst-actions .sign-out, .vst-actions .primary { flex: 1 1 0; min-width: 0; padding: 0 6px; }
}

@media (min-width: 768px) {
    .veh-grid .data-head,
    .veh-grid .data-row { grid-template-columns: 7rem minmax(0, 1.4fr) minmax(0, 1fr) 5rem minmax(0, 1.3fr) 11rem 6rem; }
    .veh-grid .staff-meta, .vst-grid .staff-meta { display: contents; color: var(--foreground); }
    .veh-grid .data-row .sign-out { justify-self: end; height: 32px; padding: 0 12px; }
    #vehicles-details .staff-form { max-width: 44rem; }

    .vst-grid { max-width: 64rem; }
    .vst-grid .data-head,
    .vst-grid .data-row { grid-template-columns: 8rem minmax(0, 1fr) 6rem minmax(0, 1.2fr) 16rem; }
    .vst-row.open { background: var(--nav-active); }
    .vst-actions { flex-wrap: nowrap; justify-content: flex-end; }
    .vst-actions .sign-out, .vst-actions .primary { height: 32px; padding: 0 12px; font-size: 0.85rem; }
    .vst-grid .vst-detail { border: 0; border-radius: 0; border-bottom: 1px solid var(--border); padding: 12px 16px 16px 36px; }
    .vst-form { max-width: 44rem; }
}
