/* Vehicles (2026-09-26) -- the board, plus the Vehicle and Log tabs of the
   record page (which otherwise wears the shared entity-detail styles). */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #F2F2F4; color: #222; font-family: "Segoe UI", system-ui, sans-serif; }

/* ---- the board ---- */
.vh-board.page-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.vh-board #lwIconBand, .vh-board .ct-header, .vh-filters { flex: 0 0 auto; }

.ct-header { background: #3C3C3C; color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.ct-header h1 { margin: 0; font-size: 14pt; font-weight: 600; flex: 1; }
.ct-header button { color: #fff; background: #4F46E5; border: none; border-radius: 4px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.ct-header button:hover { background: #6257F0; }

.vh-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; border-bottom: 1px solid #E2E2E6; }
.vh-chip { border: 1px solid #D3D3D9; background: #F7F7F9; color: #444; border-radius: 999px; padding: 5px 13px; font: inherit; font-size: 13px; cursor: pointer; }
.vh-chip:hover { background: #EDEDF2; }
.vh-chip.is-on { background: #4F46E5; border-color: #4F46E5; color: #fff; }
.vh-search { flex: 1; min-width: 160px; padding: 7px 10px; font: inherit; font-size: 13px; border: 1px solid #D3D3D9; border-radius: 6px; background: #fff; }

.vh-body { flex: 1; overflow: auto; padding: 14px 16px 28px; }
.vh-status-line { font-size: 12px; color: #777; margin-bottom: 10px; min-height: 14px; }
.vh-list { display: flex; flex-direction: column; gap: 10px; }

.vh-card { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid #E2E2E6; border-left: 4px solid #0A66C2; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.vh-card:hover { background: #FAFAFC; }
.vh-card.is-inactive { border-left-color: #9AA0A6; }
.vh-card.is-inactive .vh-title { color: #555; }
.vh-title { font-size: 15px; font-weight: 600; color: #1B1B1F; }
.vh-sub { font-size: 13px; color: #555; margin-top: 2px; }
.vh-meta { font-size: 12px; color: #666; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 12px; }
.vh-last { font-size: 12px; color: #777; margin-top: 4px; }
.vh-dues { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.vh-more { margin: 14px auto 0; display: block; border: 1px solid #D3D3D9; background: #fff; border-radius: 6px; padding: 8px 18px; font: inherit; font-size: 13px; cursor: pointer; }

/* Expiry badges: grey when fine, amber when due within 30 days, red when lapsed. */
.vh-due { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: #EEF0F5; color: #414553; }
.vh-due.is-soon { background: #FFF4D6; color: #7A5200; }
.vh-due.is-expired { background: #FDE2E2; color: #9B1C1C; }

/* ---- record page: the Vehicle tab ---- */
.vh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.vh-kpi { background: #F7F9FC; border: 1px solid #E3E9F2; border-radius: 8px; padding: 10px 12px; }
.vh-kpi .k { font-size: 11px; color: #667; text-transform: uppercase; letter-spacing: .4px; }
.vh-kpi .v { font-size: 17px; font-weight: 600; color: #1B1B1F; margin-top: 2px; }
.vh-section { margin-bottom: 16px; }

/* Sub tabs of the Vehicle tab (Story 5644): All, then one per part of the record. */
/* One row that scrolls sideways, never wraps (2026-10-19), like the record's own tab strip. */
.vh-subtabs {
    display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: 12px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.vh-subtabs::-webkit-scrollbar { display: none; }
.vh-subtabs .vh-chip { flex: 0 0 auto; white-space: nowrap; }
.vh-empty { font-size: 13px; color: #777; }
/* Sections of the All view fold, remembered; the Fold All double caret sits with the buttons. */
.vh-fold-head { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.vh-fold-chev { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #0A66C2; transition: transform .15s; }
.vh-fold.collapsed .vh-fold-chev { transform: rotate(-90deg); }
.vh-fold.collapsed > .vh-fold-body { display: none; }
.vh-foldall { font-size: 15px; line-height: 1; padding: 4px 10px; }
.vh-foldall[hidden] { display: none; }
.vh-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #0A66C2; margin: 0 0 4px; }
.vh-notes { white-space: pre-wrap; font-size: 13px; color: #222; }
.vh-inactive-note { font-size: 13px; color: #555; background: #F2F4F7; border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; }
.ed-info-form h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #0A66C2; margin: 16px 0 8px; }
.ed-info-form h3:first-child { margin-top: 0; }
.ed-info-form .err { color: #C00000; font-size: 13px; min-height: 16px; margin: 6px 0; }
.ed-info-form .actions { display: flex; gap: 8px; }

/* ---- record page: the Log tab ---- */
.vh-log-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid #EEE; margin-bottom: 12px; }
.vh-log-toolbar .vh-cat-filter { min-width: 170px; }
.vh-log-status { font-size: 12px; color: #666; margin-left: auto; }
.vh-entry { border: 1px solid #E7E7EC; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.vh-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.vh-entry-date { font-size: 12px; color: #666; min-width: 80px; }
.vh-cat { font-size: 11px; font-weight: 600; color: #1F4E8C; background: #E5F0FF; border-radius: 999px; padding: 1px 8px; }
.vh-entry-summary { font-size: 14px; font-weight: 600; color: #1B1B1F; flex: 1; min-width: 140px; }
.vh-entry-cost { font-size: 13px; font-weight: 600; color: #1B1B1F; }
.vh-entry-meta { font-size: 12px; color: #666; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 12px; }
.vh-entry-details { font-size: 13px; color: #333; margin-top: 6px; white-space: pre-wrap; }
.vh-entry-btns { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.vh-entry-btns .ed-btn { padding: 4px 10px; font-size: 11px; }
/* Story 6818: files on a log entry */
.vh-entry-btns .ed-btn.vh-has-files { border-color: #1E5FAF; color: #1E5FAF; font-weight: 600; }
.vh-entry-files { margin-top: 8px; border-top: 1px dashed #D8E3F2; padding-top: 8px; }
.vh-entry-files-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.vh-entry-files-title { font-size: 12px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .04em; }
.vh-entry-files-bar .ed-btn { padding: 4px 10px; font-size: 11px; }
.vh-entry-files-empty { font-size: 13px; color: #666; padding: 4px 0; }
.vh-entry-form { border: 1px solid #D8E3F2; background: #FAFCFF; border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.vh-log-more { margin: 10px auto 0; display: block; }

/* The Spent card (2026-10-18): three small figures side by side, then the linked expense
   accounts as chips. It spans two columns of the figures strip so the three fit. */
.vh-kpi.vh-spent { grid-column: span 2; }
.vh-spent-row { display: flex; gap: 6px; margin-top: 4px; }
.vh-spent-fig {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: flex-start;
    background: none; border: 0; padding: 2px 4px; margin: 0; border-radius: 6px;
    font: inherit; color: inherit; text-align: left;
}
button.vh-spent-fig { cursor: pointer; }
button.vh-spent-fig:hover, button.vh-spent-fig:focus-visible { background: #E8F0FA; outline: none; }
.vh-spent-fig .l { font-size: 11px; color: #667; }
.vh-spent-fig .v { font-size: 15px; font-weight: 600; color: #1B1B1F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
button.vh-spent-fig .v { color: #0A66C2; }
.vh-spent-accts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.vh-acct-chip {
    background: #fff; border: 1px solid #C9D6E6; color: #29506B; border-radius: 12px;
    padding: 2px 9px; font-size: 11.5px; cursor: pointer; max-width: 100%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vh-acct-chip:hover { background: #E8F0FA; }
.vh-spent-note { font-size: 11px; color: #777; margin-top: 6px; }
.vh-field-hint { font-size: 11.5px; color: #667; margin-top: 4px; }

/* The transactions window: the Record View's sepia shell with a table in it. */
.ed-rview.vh-tx { width: min(860px, 100%); }
.vh-tx-sum { font: 13px "Segoe UI", system-ui, sans-serif; color: #6f6144; margin-bottom: 10px; }
.vh-tx-empty { font: 14px Georgia, serif; color: #9c8c6a; padding: 8px 0; }
.vh-tx-table { width: 100%; border-collapse: collapse; font: 13px "Segoe UI", system-ui, sans-serif; color: #3b3323; }
.vh-tx-table th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #6f6144;
    border-bottom: 1px solid #d8c9a6; padding: 4px 6px;
}
.vh-tx-table td { border-bottom: 1px dotted #d8c9a6; padding: 6px; vertical-align: top; }
.vh-tx-table .num { text-align: right; white-space: nowrap; }
.vh-tx-table .neg { color: #1A7A3C; }
.vh-tx-table .d { white-space: nowrap; }
.vh-tx-table .w { overflow-wrap: anywhere; }
.vh-tx-table .s { display: block; font-size: 11.5px; color: #6f6144; }

@media (max-width: 560px) {
    .ed-info-form .field-row { flex-direction: column; gap: 0; }
}

@media print {
    .vh-fold.collapsed > .vh-fold-body { display: block !important; }
    .vh-subtabs, .vh-fold-chev, .vh-filters, .vh-more, .ct-header button, .vh-log-toolbar, .vh-entry-btns { display: none !important; }
}
