/* Sổ tay xe 2.0 — components.css · thư viện thành phần (xem docs/v2/UI-KIT.md) · © Kiên VC
 * Mục lục: 1 Nút · 2 Thẻ / danh sách / dòng · 3 Badge trạng thái / pill / thanh tiến độ · 4 Biểu mẫu · 5 Chip / segmented / tìm kiếm · 6 Stepper
 *          7 Sheet / tile Ghi nhanh / hộp thoại · 8 Toast / banner / trống / skeleton · 9 Tiêu đề mục / nhóm / fold / tab
 *          10 Ảnh xe / VehicleCard / Metric / Tổng quan (.ovc) / MaintenanceItem · 11 Bảng / biểu đồ / dòng thời gian
 *          12 total-box (form). */

/* ============ 1. NÚT ============ */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--r-ctl); background: var(--btn); color: var(--on-btn);
  font-weight: 600; font-size: 16px; line-height: 1.2; text-align: center; text-decoration: none;
  transition: transform .1s ease, background-color .15s ease, opacity .15s ease; -webkit-user-select: none; user-select: none;
}
.btn:active { transform: scale(.97); background: var(--btn-press); }
.btn:focus-visible { outline-offset: 3px; border-radius: var(--r-ctl); }
.btn.block { display: flex; width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:active { background: var(--surface-2); }
.btn.tertiary { background: transparent; color: var(--accent); }
.btn.tertiary:active { background: var(--blue-soft); }
.btn.danger { background: var(--danger-btn); color: #fff; }
.btn.danger:active { background: var(--danger-btn-press); }
.btn.soft { background: var(--blue-soft); color: var(--accent); }                       /* nút phụ nền xanh nhạt */
.btn.soft:active { background: var(--blue-soft); filter: brightness(.95); }
.btn.grey { background: var(--surface-3); color: var(--text); }
.btn.grey:active { background: var(--border-strong); }
.btn.red { background: var(--st-over-bg); color: var(--st-over-fg); }                    /* nguy hiểm dạng nhạt (xoá…) */
.btn.red:active { filter: brightness(.95); }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn.loading { color: transparent !important; pointer-events: none; --sp: #fff; }
.btn.loading svg { opacity: 0; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--sp); border-top-color: transparent; animation: spin .7s linear infinite; }
.btn.secondary.loading, .btn.tertiary.loading, .btn.soft.loading, .btn.grey.loading, .btn.red.loading { --sp: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1 1 0; min-width: 0; }
.btns > .btn { padding: 0 12px; font-size: 15px; }
.btns > .btn.sm { font-size: 14px; }

/* ============ 2. THẺ / DANH SÁCH / DÒNG ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--sh-1); padding: 16px; }
.card.flat { box-shadow: none; }
.card.pad0 { padding: 0; overflow: hidden; }
.card.navy { background: var(--grad); color: #fff; border-color: transparent; }
.card + .card { margin-top: 12px; }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--sh-1); overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; width: 100%; background: none; border: 0; text-align: left; }
.list > .row + .row, .list > * + .row, .list > .mrow + .mrow { border-top: 1px solid var(--border); }
.row[data-go], .row[data-act], .row.tap { cursor: pointer; }
.row[data-go]:active, .row[data-act]:active, .row.tap:active { background: var(--surface-2); }
.row .ico { width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; font-size: 20px; background: var(--surface-3); flex: none; }
.row .ico svg { width: 22px; height: 22px; }
.row .main { flex: 1 1 auto; min-width: 0; }
.row .ttl { font-weight: 600; overflow-wrap: anywhere; }
.row .meta { color: var(--text-2); font-size: var(--fs-cap); overflow-wrap: anywhere; }
.row.wrapacts { flex-wrap: wrap; row-gap: 6px; }
.row.wrapacts .main { flex: 1 1 120px; }
.row > .num, .row > .b.num { flex: none; white-space: nowrap; }
.row .acts { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.row .chev { color: var(--text-3); flex: none; width: 18px; height: 18px; display: inline-flex; }
.row .chev svg { width: 18px; height: 18px; }
label.row { cursor: pointer; }

/* ============ 3. BADGE TRẠNG THÁI / PILL / TIẾN ĐỘ ============ */
/* 5 trạng thái: st-over (Quá hạn) · st-maybe (Có thể quá hạn) · st-soon (Sắp đến hạn) · st-ok (Đang ổn) · st-unk (Chưa rõ). LUÔN có chữ + icon. */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; line-height: 16px; white-space: nowrap; background: var(--st-unk-bg); color: var(--st-unk-fg); flex: none; }
.badge svg { width: 14px; height: 14px; flex: none; }
.badge.sm { font-size: 12px; padding: 2px 8px 2px 6px; line-height: 15px; }
.badge.st-over { background: var(--st-over-bg); color: var(--st-over-fg); }
.badge.st-maybe { background: var(--st-maybe-bg); color: var(--st-maybe-fg); box-shadow: inset 0 0 0 1px var(--st-maybe-bar); }   /* viền cam = ước tính */
.badge.st-soon { background: var(--st-soon-bg); color: var(--st-soon-fg); }
.badge.st-ok { background: var(--st-ok-bg); color: var(--st-ok-fg); }
.badge.st-unk { background: var(--st-unk-bg); color: var(--st-unk-fg); }
.pill.est { background: var(--st-maybe-bg); color: var(--st-maybe-fg); box-shadow: inset 0 0 0 1px var(--st-maybe-bar); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap; background: var(--st-unk-bg); color: var(--st-unk-fg); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--st-unk-bar); flex: none; }
.dot.st-over { background: var(--st-over-bar); } .dot.st-maybe { background: var(--st-maybe-bar); } .dot.st-soon { background: var(--st-soon-bar); } .dot.st-ok { background: var(--st-ok-bar); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: var(--st-ok-bar); transition: width .3s ease; }
.progress.st-soon > i { background: var(--st-soon-bar); }
.progress.st-maybe > i { background: repeating-linear-gradient(135deg, var(--st-maybe-bar) 0 6px, var(--st-soon-bar) 6px 12px); }   /* sọc = ước tính */
.progress.st-over > i { background: var(--st-over-bar); }
.progress.st-unk > i { background: var(--st-unk-bar); }

/* ============ 4. BIỂU MẪU ============ */
.field { margin: 0 0 16px; }
.field > label, .lbl { display: block; font-size: var(--fs-cap); font-weight: 600; color: var(--text-2); margin: 0 0 6px 2px; }
.field .req { color: var(--st-over-fg); }
.hint { font-size: var(--fs-tiny); color: var(--faint); margin: 6px 2px 0; }
.field.has-err > .hint { display: none; }
.field .hint { margin-top: 6px; }
.err-msg { display: flex; align-items: flex-start; gap: 6px; color: var(--st-over-fg); font-size: var(--fs-cap); font-weight: 500; margin: 6px 2px 0; }
.err-msg::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 1px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center/contain no-repeat; }
.input, select.input, textarea.input {
  display: block; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-ctl); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 16px; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.4; }
select.input { font-weight: 500; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' stroke='%236A7487' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5l5.5 5.5 5.5-5.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; }
input[type="date"].input { min-height: 48px; line-height: 24px; text-align: left; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; min-height: 1.5em; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.input.err, .field.has-err .input { border-color: var(--danger); }
.input.err:focus, .field.has-err .input:focus { box-shadow: 0 0 0 4px var(--st-over-bg); }
.input::placeholder { color: var(--text-3); opacity: 1; }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--text-2); }
.with-unit { position: relative; } .with-unit .input { padding-right: 56px; } .with-unit.cur .input { padding-right: 36px; }
.with-unit .u { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); font-size: 14px; font-weight: 600; pointer-events: none; }
input[type="search"].input { padding-left: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236A7487' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 13px center; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; z-index: 1; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--r-pill); transition: background-color .2s; }
.switch i::after { content: ""; position: absolute; width: 27px; height: 27px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); }
.switch input:checked + i { background: var(--success); } .switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--focus); outline-offset: 2px; }
.stars { display: inline-flex; gap: 0; } .stars button { border: 0; background: none; font-size: 26px; min-width: 40px; min-height: 44px; padding: 0; color: var(--star-off); line-height: 1; }
.stars button.on { color: #F5A623; } .stars.ro button { font-size: 14px; min-width: 0; min-height: 0; padding: 0 1px; pointer-events: none; }
.formline { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 10px; margin-bottom: 10px; }
.formline .x { border: 0; background: none; color: var(--text-2); font-size: 22px; line-height: 1; min-width: 44px; min-height: 44px; margin: -6px -8px -6px 0; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos .ph { width: 76px; height: 76px; border-radius: var(--r-ctl); background: var(--surface-3); overflow: hidden; position: relative; border: 0; padding: 0; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph .x { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .62); color: #fff; border: 0; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.photos .add { border: 2px dashed var(--border-strong); color: var(--text-2); font-size: 28px; display: grid; place-items: center; background: none; }
img[data-photo]:not([src]) { opacity: 0; }

/* ============ 5. CHIP / SEGMENTED / TÌM KIẾM ============ */
.seg { display: flex; background: var(--surface-3); border-radius: var(--r-ctl); padding: 3px; gap: 2px; }
.seg button { flex: 1 1 0; min-width: 0; border: 0; background: none; padding: 0 6px; border-radius: 9px; min-height: 44px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20, 43, 74, .16); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--r-pill); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip:active { transform: scale(.97); }
.chip.on { background: var(--blue-soft); color: var(--accent); border-color: var(--blue); }
.chip .n { font-size: 12px; font-weight: 700; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gxr)) 0 calc(-1 * var(--gxl)); padding: 2px var(--gxr) 6px var(--gxl); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: none; }
.searchbox { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 0 0 12px; background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--r-ctl); }
.searchbox:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.searchbox .sb-ico { width: 20px; height: 20px; color: var(--text-2); flex: none; display: inline-flex; }
.searchbox .sb-ico svg { width: 20px; height: 20px; }
.searchbox input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; font-size: 16px; color: var(--text); -webkit-appearance: none; appearance: none; }
.searchbox input::placeholder { color: var(--text-3); opacity: 1; }
.searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; }
.searchbox .sb-x { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--text-2); }
.searchbox .sb-x svg { width: 18px; height: 18px; }
.searchbox input:placeholder-shown ~ .sb-x { display: none; }

/* ============ 6. STEPPER ============ */
.stepper { margin: 4px 0 16px; }
.stepper ol { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.stepper li { display: flex; align-items: center; flex: 1 1 0; min-width: 0; }
.stepper li:last-child { flex: 0 0 auto; }
.stp-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.stp-dot svg { width: 15px; height: 15px; stroke-width: 3; }
.stepper li.on .stp-dot { background: var(--btn); color: #fff; box-shadow: 0 0 0 4px var(--blue-soft); }
.stepper li.done .stp-dot { background: var(--blue-soft); color: var(--accent); }
.stp-line { flex: 1 1 auto; height: 2px; margin: 0 6px; background: var(--border-strong); border-radius: 1px; }
.stepper li.done .stp-line { background: var(--blue); }
.stp-cap { margin-top: 8px; font-size: 13px; color: var(--text-2); }
.stp-cap b { color: var(--text); font-weight: 600; }

/* ============ 7. SHEET / TILE GHI NHANH / HỘP THOẠI ============ */
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .2s; pointer-events: auto; }
.scrim.in { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: var(--col); max-height: 88vh; max-height: 88dvh; overflow: auto; pointer-events: auto;
  background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 8px var(--gutter) calc(var(--sab) + 16px); box-shadow: var(--sh-sheet);
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.sheet.in { transform: none; }
.sheet:focus { outline: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 14px; }
.sheet h3 { margin: 0 0 12px; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sheet .sub { margin: -6px 0 12px; }
.sheet .opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 8px; border: 0; background: none; text-align: left; border-radius: var(--r-ctl); font-size: 16px; font-weight: 600; min-height: 56px; }
.sheet .opt:active { background: var(--surface-2); }
.sheet .opt .ico { width: 44px; height: 44px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--blue-soft); font-size: 22px; flex: none; }
.sheet .opt .ico svg { width: 22px; height: 22px; color: var(--accent); }
.sheet .opt small { display: block; color: var(--text-2); font-weight: 400; font-size: var(--fs-cap); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 112px; padding: 14px; border: 0; border-radius: var(--r-card); text-align: left; background: var(--tone-grey-bg); --tf: var(--tone-grey-fg); color: var(--text); transition: transform .1s; }
.tile:active { transform: scale(.97); }
.tile .t-ico { width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--surface); color: var(--tf); flex: none; margin-bottom: 2px; }
.tile .t-ico svg { width: 22px; height: 22px; }
.tile .t-label { font-weight: 700; font-size: 15px; line-height: 1.2; }
.tile .t-hint { font-size: var(--fs-tiny); line-height: 1.3; font-weight: 500; color: var(--tf); }
.tile.tone-blue { background: var(--tone-blue-bg); --tf: var(--tone-blue-fg); }
.tile.tone-orange { background: var(--tone-orange-bg); --tf: var(--tone-orange-fg); }
.tile.tone-green { background: var(--tone-green-bg); --tf: var(--tone-green-fg); }
.tile.tone-purple { background: var(--tone-purple-bg); --tf: var(--tone-purple-fg); }
.tile.tone-red { background: var(--tone-red-bg); --tf: var(--tone-red-fg); }
.tile.tone-teal { background: var(--tone-teal-bg); --tf: var(--tone-teal-fg); }
.tone-blue-bg { background: var(--tone-blue-bg); color: var(--tone-blue-fg); } .tone-orange-bg { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.tone-green-bg { background: var(--tone-green-bg); color: var(--tone-green-fg); } .tone-purple-bg { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.tone-red-bg { background: var(--tone-red-bg); color: var(--tone-red-fg); } .tone-teal-bg { background: var(--tone-teal-bg); color: var(--tone-teal-fg); }
.tone-grey-bg { background: var(--tone-grey-bg); color: var(--tone-grey-fg); }
.dlg { position: absolute; left: 24px; right: 24px; top: 50%; transform: translateY(-50%) scale(.96); max-width: 400px; margin: 0 auto; background: var(--surface); border-radius: 20px; padding: 20px; box-shadow: var(--sh-3); opacity: 0; transition: opacity .18s, transform .18s; pointer-events: auto; }
.dlg.in { opacity: 1; transform: translateY(-50%) scale(1); }
.dlg.up { top: 14%; transform: translateY(0) scale(.96); }                    /* có ô nhập: đẩy lên để bàn phím không che */
.dlg.up.in { transform: translateY(0) scale(1); }
.dlg:focus { outline: none; }
.dlg h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.dlg p { margin: 0 0 16px; color: var(--text-2); font-size: 14px; }

/* ============ 8. TOAST / BANNER / TRỐNG / SKELETON ============ */
#toast .t { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 12px 8px 12px 16px; border-radius: 14px; background: var(--toast-bg); color: var(--toast-fg); font-size: 15px; box-shadow: var(--sh-3); pointer-events: auto; animation: tin .22s ease-out; }
#toast .t:not(:has(button)) { padding-right: 16px; }
#toast .t > span { min-width: 0; overflow-wrap: anywhere; }
#toast .t .ti { width: 20px; height: 20px; flex: none; }
#toast .t.ok .ti { color: var(--success); } #toast .t.warn .ti { color: var(--warning); } #toast .t.err .ti { color: var(--danger); }
#toast .t button { flex: none; border: 0; background: none; color: var(--toast-act); font-weight: 700; font-size: 15px; min-height: 44px; padding: 0 10px; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-card); font-size: 14px; margin: 12px 0 0; background: var(--blue-soft); color: var(--text); --bf: var(--accent); }
.banner > .bi { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--bf); display: inline-flex; }
.banner > .bi svg { width: 22px; height: 22px; }
.banner > div, .banner > span { min-width: 0; flex: 1 1 auto; }
.banner .x { flex: none; border: 0; background: none; color: var(--text-2); font-size: 22px; line-height: 1; width: 44px; height: 44px; margin: -10px -10px -10px 0; }
.banner.warn { background: var(--st-soon-bg); --bf: var(--st-soon-fg); }
.banner.bad { background: var(--st-over-bg); --bf: var(--st-over-fg); }
.banner.ok { background: var(--st-ok-bg); --bf: var(--st-ok-fg); }
.banner .btn { margin-top: 8px; }
.banner .btns { margin-top: 8px; }
.banner .btns > .btn { margin-top: 0; }
.empty { text-align: center; padding: 40px 8px; color: var(--text-2); }
.empty .big { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 34px; color: var(--text-2); }
.empty .big svg { width: 34px; height: 34px; }
.empty h3 { margin: 4px 0 6px; color: var(--text); font-size: 18px; font-weight: 700; }
.empty p { margin: 0 auto 16px; max-width: 320px; font-size: 14px; }
.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 40%, var(--surface-3) 60%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.skel-list { display: grid; gap: 10px; }
.skel-card { height: 76px; border-radius: var(--r-card); }
.skel.line { height: 12px; } .skel.w40 { width: 40%; } .skel.w60 { width: 60%; } .skel.w80 { width: 80%; }

/* ============ 9. TIÊU ĐỀ MỤC / NHÓM / FOLD / TAB ============ */
.sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 8px; min-height: 28px; }
.sec .count { font-size: var(--fs-cap); color: var(--text-2); }
.sec .more { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 600; min-height: 44px; margin: -8px -8px -8px 0; padding: 0 8px; white-space: nowrap; }
.sec .more svg { width: 16px; height: 16px; }
.group-h { display: flex; align-items: center; gap: 8px; margin: 20px 2px 8px; font-size: 14px; font-weight: 700; color: var(--text); }
.group-h .gh-i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--st-unk-bg); color: var(--st-unk-fg); flex: none; }
.group-h .gh-i svg { width: 14px; height: 14px; }
.group-h.st-over .gh-i { background: var(--st-over-bg); color: var(--st-over-fg); } .group-h.st-maybe .gh-i { background: var(--st-maybe-bg); color: var(--st-maybe-fg); }
.group-h.st-soon .gh-i { background: var(--st-soon-bg); color: var(--st-soon-fg); } .group-h.st-ok .gh-i { background: var(--st-ok-bg); color: var(--st-ok-fg); }
.group-h .gh-n { font-weight: 600; font-size: 12px; color: var(--text-2); background: var(--surface-3); border-radius: var(--r-pill); padding: 1px 8px; }
details.fold { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); margin: 12px 0; }
details.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 0 16px; font-weight: 600; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .fs { display: block; font-weight: 400; font-size: var(--fs-cap); color: var(--text-2); }
details.fold > summary::after { content: ""; flex: none; width: 18px; height: 18px; background: var(--text-2); transition: transform .2s; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat; }
details.fold[open] > summary::after { transform: rotate(180deg); }
details.fold > .fold-body { padding: 4px 16px 16px; }
.tabs { position: relative; display: flex; overflow-x: auto; margin: 12px calc(-1 * var(--gxr)) 14px calc(-1 * var(--gxl)); padding: 0 calc(var(--gxr) - 8px) 0 calc(var(--gxl) - 8px); border-bottom: 1px solid var(--border); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; background: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--blue); font-weight: 700; }
.tabs .cnt { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger-btn); color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.tabs .cnt.amber { background: var(--st-soon-bar); color: #1C1300; }

/* ============ 10. ẢNH XE / VEHICLECARD / METRIC / TỔNG QUAN / MAINTENANCEITEM ============ */
.vph { position: relative; overflow: hidden; display: grid; place-items: center; flex: none; background: linear-gradient(160deg, #E6EDF8, #D3DFF1); color: #5C7699; }
.vph.moto { background: linear-gradient(160deg, #E4F0F1, #D0E4E7); color: #4F7C82; }
:root[data-theme="dark"] .vph { background: linear-gradient(160deg, #1D2B46, #16223A); color: #6F8BB5; }
:root[data-theme="dark"] .vph.moto { background: linear-gradient(160deg, #17313A, #12252E); color: #6FA3AB; }
.vph .tire { fill: #142B4A; opacity: .82; }
:root[data-theme="dark"] .vph .tire { fill: #050B14; opacity: .95; }
.vph svg.sil { width: 78%; height: auto; max-height: 82%; }
.vph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vph.xs { width: 44px; height: 44px; border-radius: 10px; } .vph.sm { width: 56px; height: 56px; border-radius: var(--r-ctl); }
.vph.md { width: 72px; height: 72px; border-radius: 14px; }
.vph.lg { width: 100%; aspect-ratio: 2 / 1; border-radius: 0; }
.vph.xs svg.sil, .vph.sm svg.sil { width: 84%; }
.plate { display: inline-block; font-weight: 700; font-size: 12px; letter-spacing: .04em; padding: 1px 8px; border: 1.5px solid var(--text); border-radius: 6px; background: var(--surface); color: var(--text); line-height: 1.5; white-space: nowrap; }
.vehcard { position: relative; display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--sh-1); overflow: hidden; text-align: left; cursor: pointer; }
.vehcard:active { transform: scale(.985); }
.vehcard.selected { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.vehcard .vc-name { font-weight: 700; font-size: var(--fs-card); line-height: 1.25; min-width: 0; }
.vehcard .vc-sub { font-size: var(--fs-cap); color: var(--text-2); }
.vehcard .vc-km { font-size: 14px; color: var(--text-2); }
.vehcard .vc-km b { color: var(--text); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vehcard .vc-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.vehcard .vc-cta { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.vehcard.featured { flex-direction: column; }
.vehcard.featured .vc-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.vehcard.featured .vc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.vehcard.compact { align-items: center; gap: 12px; padding: 12px; }
.vehcard.compact .vc-body { display: grid; gap: 3px; min-width: 0; flex: 1 1 auto; }
.vehcard.compact .vc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vehcard.compact .vc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metrics.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--sh-1); padding: 14px 16px; min-width: 0; }
.metric .mk { font-size: var(--fs-cap); font-weight: 500; color: var(--text-2); }
.metric .mv { font-size: var(--fs-metric); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; }
.metric .ms { font-size: var(--fs-tiny); color: var(--text-2); margin-top: 2px; }
.metric.primary { background: var(--grad); border-color: transparent; color: #fff; }
.metric.primary .mk, .metric.primary .ms { color: rgba(255, 255, 255, .82); }
.metric.compact { padding: 10px 12px; }
.metric.compact .mv { font-size: 22px; }
.metrics.c3 .metric { padding: 10px 10px; } .metrics.c3 .metric .mv { font-size: 22px; }
.ovc { position: relative; overflow: hidden; background: linear-gradient(145deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; border-radius: var(--r-card); padding: 16px; margin-top: 8px; }
.ovc::after { content: ""; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none; }
.ovc > * { position: relative; z-index: 1; }
.ovc .ovc-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ovc .ovc-title { font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .92); }
.ovc .ovc-sub { font-size: var(--fs-cap); color: rgba(255, 255, 255, .78); margin-top: 2px; }
.ovc .ovc-count { display: flex; align-items: baseline; gap: 6px; flex: none; }
.ovc .ovc-count b { font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ovc .ovc-count span { font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .85); }
.ovc .ovc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.ovc .ovc-st { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: var(--r-ctl); background: rgba(255, 255, 255, .1); color: #fff; text-align: left; border: 0; min-width: 0; }
.ovc .ovc-st .oi { display: flex; align-items: center; gap: 6px; }
.ovc .ovc-st .oi svg { width: 16px; height: 16px; flex: none; }
.ovc .ovc-st.st-ok .oi { color: #6BE3AC; } .ovc .ovc-st.st-soon .oi { color: #FFD27A; } .ovc .ovc-st.st-over .oi { color: #FFA9B0; }
.ovc .ovc-st b { font-size: 24px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.ovc .ovc-st .ol { font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .88); }
.ovc button.ovc-st:active { background: rgba(255, 255, 255, .18); transform: scale(.97); }
.mrow { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px; width: 100%; text-align: left; background: none; border: 0; }
.mrow[data-go], .mrow.tap { cursor: pointer; }
.mrow.tap:active { background: var(--surface-2); }
.mrow .mi { width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; font-size: 20px; background: var(--surface-3); flex: none; }
.mrow .mi svg { width: 22px; height: 22px; }
.mrow .mm { flex: 1 1 auto; min-width: 0; }
.mrow .mt { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mrow .mn { font-weight: 600; font-size: 15px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.mrow .md { font-size: var(--fs-cap); color: var(--text-2); margin-top: 2px; }
.mrow .md.est::before { content: "≈ "; font-weight: 700; }
.mrow .progress { margin-top: 8px; }
.mrow .mf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; font-size: var(--fs-tiny); color: var(--text-2); }
.mrow .ma { display: flex; gap: 8px; margin-top: 10px; }
.mrow .ma .btn { flex: 1 1 0; }
.card > .mrow, .acard .mrow { padding: 0; }

/* ============ 11. BẢNG / BIỂU ĐỒ / DÒNG THỜI GIAN ============ */
.kv { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: 0; font-size: 15px; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--border); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--text-2); font-size: 14px; padding-right: 8px; } .kv .v { overflow-wrap: anywhere; font-weight: 600; }
.legend { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; font-size: 14px; min-width: 0; }
.legend .li { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.legend .li + .li { border-top: 1px solid var(--border); }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend .nm { flex: 1 1 auto; min-width: 0; font-weight: 500; } .legend .pc { color: var(--text-2); font-size: 12px; width: 36px; text-align: right; }
.legend .am { font-weight: 700; text-align: right; flex: none; }
.donutw { display: flex; align-items: center; gap: 16px; }
.donut { position: relative; width: 132px; height: 132px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .mid b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; } .donut .mid span { font-size: 12px; color: var(--text-2); font-weight: 500; }
.tblw { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--sh-1); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 10px 12px; background: var(--surface-2); }
.tbl td { padding: 12px 12px; border-top: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.tbl .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); }
.hbar { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; }
.hbar + .hbar { border-top: 1px solid var(--border); }
.chart text { fill: var(--text-2); font-size: 10px; font-family: inherit; }
.chart .bar-rect { fill: var(--blue); } .chart .bar-rect.old { opacity: .42; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 1px; }
.tl .it { position: relative; padding: 4px 0 14px; cursor: pointer; }
.tl .it::before { content: ""; position: absolute; left: -22px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 4px solid var(--blue); }
.tl .it.red::before { border-color: var(--st-over-bar); } .tl .it.amber::before { border-color: var(--st-soon-bar); } .tl .it.green::before { border-color: var(--st-ok-bar); }
.tl .dt { font-size: 12px; font-weight: 700; color: var(--text-2); }
.tl .tt { font-weight: 600; } .tl .ss { font-size: 13px; color: var(--text-2); }

/* ============ 12. Tổng tiền (total-box) — dùng trong form ============ */
.total-box { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 16px; border-radius: var(--r-ctl); background: var(--grad); color: #fff; font-weight: 600; }
.total-box .v { font-size: 24px; font-weight: 700; }
