/* PSK Business ERP — Vehicle & Delivery Management styles */

/* KPI rows */
.fleet-kpis .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dlv-kpis .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1700px) { .dlv-kpis .kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .fleet-kpis .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dlv-kpis .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* profit contribution bar (diverges from the centre line) */
.pbar { position: relative; height: 8px; border-radius: 6px; background: #EEF2F8; }
.pbar::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: #B6C0D2; }
.pbar i { position: absolute; top: 0; bottom: 0; min-width: 2px; }
.pbar i.pos { left: 50%; background: var(--success); border-radius: 0 4px 4px 0; }
.pbar i.neg { right: 50%; background: var(--danger); border-radius: 4px 0 0 4px; }

/* trip form */
.trip-static { display: flex; align-items: center; min-height: 38px; font-weight: 600; }
.trip-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.trip-sum div { display: flex; flex-direction: column; padding: 10px 14px; border-right: 1px solid var(--line-2); }
.trip-sum div:last-child { border-right: 0; }
.trip-sum span { font-size: 12px; color: var(--muted); }
.trip-sum b { font-size: 16px; font-variant-numeric: tabular-nums; }
.trip-route, .trip-mat { max-width: 200px; }
.dlv-cust { max-width: 210px; }
.trip-route span, .trip-route small, .trip-mat span, .trip-mat small, .dlv-cust span, .dlv-cust small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlv-items { max-width: 190px; font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-list .list-right { gap: 2px; }
.log-list .list-main small { white-space: normal; }

/* dispatch board */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.board-col { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; display: flex; flex-direction: column; min-width: 0; }
.board-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.board-head em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--text-2); background: #E9EEF5; border-radius: 9px; padding: 1px 8px; }
.board-list { display: flex; flex-direction: column; gap: 10px; padding: 10px; max-height: 420px; overflow-y: auto; }
.board-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; box-shadow: var(--shadow-xs); cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; }
.board-card:hover { box-shadow: var(--shadow-md); border-color: #D0D9E8; transform: translateY(-1px); }
.board-card.late { border-left: 3px solid var(--danger); }
.board-cust { font-weight: 600; font-size: 13.5px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-items { font-size: 12px; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.board-meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.board-act { margin-top: 10px; }
.board-act .btn { width: 100%; }
.board-empty { padding: 22px 8px; text-align: center; font-size: 12.5px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
@media (max-width: 1180px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -6px; padding: 0 6px 6px; }
  .board-col { flex: 0 0 84%; scroll-snap-align: start; }
  .trip-sum { grid-template-columns: 1fr; }
  .trip-sum div { border-right: 0; border-bottom: 1px solid var(--line-2); flex-direction: row; justify-content: space-between; align-items: center; }
}

/* new dispatch / proof of delivery */
.nd-empty { border: 1px dashed var(--line); border-radius: 10px; }
.nd-table td { vertical-align: middle; }
.nd-stock { margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.nd-stock.warn { color: #B45309; font-weight: 600; }
.pod-img { display: grid; place-items: center; min-height: 120px; border: 1px solid var(--line); border-radius: 10px; background: #FBFCFE; overflow: hidden; color: var(--muted); font-size: 12.5px; gap: 6px; }
.pod-img img { max-width: 100%; max-height: 220px; display: block; }
.pod-img.sig img { max-height: 120px; }
.pod-img.none { grid-auto-flow: column; justify-content: center; border-style: dashed; }
.photo-drop span { line-height: 1.6; }

/* range controls must never widen the page on small screens */
[data-module="vehicles"] .section-title { flex-wrap: wrap; }
#fl-range, #vp-range { min-width: 0; max-width: 100%; }
.board-card a.strong { white-space: nowrap; }
.board-card .flex-between > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fleet-note { display: flex; gap: 8px; align-items: flex-start; }
@media (max-width: 760px) { #fl-range, #vp-range { width: 100%; } }
