/* RouteMule Fleet Systems pieces: side menu, page header, cards, tables, lists, status pills. Colours come from theme.css. */

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); display: flex; min-height: 100vh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; letter-spacing: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
.ic { width: 20px; height: 20px; flex: none; display: block; }

/* ---------- side menu ---------- */
.side { font-family: var(--font-ui); letter-spacing: -0.01em; width: 256px; flex: none; position: sticky; top: 0; height: 100vh; background: var(--side); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); border-right: 1px solid var(--sep); display: flex; flex-direction: column; padding: 16px 12px 12px; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; white-space: nowrap; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(160deg, #3d9bff, #0057d9); color: #fff; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 87, 217, .35); flex: none; }
.logo .ic { width: 19px; height: 19px; }
.logo .mk { width: 20px; height: 19px; }
.brand-t { line-height: 1.15; white-space: nowrap; }
.brand-t b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand-t span { display: block; font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: 0; }
.s-search { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px; border-radius: 9px; background: var(--fill); color: var(--text3); margin: 0 2px 6px; }
.s-search .ic { width: 16px; height: 16px; }
.s-search input { border: 0; outline: 0; background: none; width: 100%; font-size: 14px; color: var(--text); }
.s-search input::placeholder { color: var(--text3); }
.nav { flex: 1; overflow-y: auto; }
.grp { font-size: 12px; font-weight: 600; color: var(--text3); padding: 14px 10px 6px; white-space: nowrap; }
.item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px; margin-bottom: 1px; border-radius: 9px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.item:hover { background: var(--hover); }
.item.on { background: var(--accent); color: #fff; }
.sq { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.sq .ic { width: 15px; height: 15px; stroke-width: 2.1; }
.item .badge { margin-left: auto; font-size: 13px; color: var(--text2); font-variant-numeric: tabular-nums; }
.item.on .badge { color: rgba(255, 255, 255, .85); }
.nav-gap { height: 14px; }
.foot { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--sep); margin-top: 8px; }
.av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(160deg, #a1a1a6, #6e6e73); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.who { line-height: 1.25; white-space: nowrap; min-width: 0; }
.who b { font-size: 13px; display: block; }
.who span { display: block; font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text2); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.foot .icon-btn { margin-left: auto; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }

/* ---------- page ---------- */
.main { flex: 1; min-width: 0; padding: 26px 36px 60px; }
.top { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; min-height: 58px; }
.date { font-size: 13px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 2px; white-space: nowrap; }
.date:empty { display: none; }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; margin: 0; white-space: nowrap; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-primary { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px 0 12px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 122, 255, .3); }
.btn-primary .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; white-space: nowrap; }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px 10px; }
.card-h h2 { font-size: 17px; font-weight: 700; margin: 0; white-space: nowrap; letter-spacing: -0.015em; }
.card-h a { margin-left: auto; font-size: 14px; color: var(--accent); font-weight: 500; white-space: nowrap; }
.grid { display: grid; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { padding: 18px 20px; }
.stat-h { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.tint { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.tint .ic { width: 16px; height: 16px; stroke-width: 2.1; }
.stat-v { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; margin: 12px 0 2px; font-variant-numeric: tabular-nums; }
.stat-n { font-size: 13px; color: var(--text2); white-space: nowrap; }

/* ---------- tables (never wrap: scroll sideways instead) ---------- */
.scroll-x { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 700; color: #fff; padding: 8px 12px; white-space: nowrap; background: var(--head-bg); }
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { background: color-mix(in srgb, var(--head-bg) 85%, #000); }
th.sort .arr { margin-left: 6px; font-size: 8px; opacity: .55; }
th.sort.on .arr { opacity: 1; }
td { text-align: left; padding: 0 12px; height: 30px; border-top: 1px solid var(--sep); white-space: nowrap; font-family: var(--mono); font-size: 13px; letter-spacing: 0; color: var(--text2); }
td b { font-weight: inherit; }
td .pill { height: 20px; padding: 0 8px; font-size: 11.5px; }

/* notes icon + the note that shows on hover (js/app.js FB.note) */
.note-ic { display: inline-grid; place-items: center; width: 24px; height: 22px; border-radius: 6px; color: var(--accent); cursor: default; vertical-align: middle; }
.note-ic:hover { background: var(--fill); }
.note-ic .ic { width: 16px; height: 16px; }
.note-tip { position: fixed; z-index: 100; padding: 8px 12px; border-radius: 10px; background: rgba(28, 28, 30, .95); color: #fff; font: 500 13px/1.35 var(--font); letter-spacing: 0; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:hover td { background: var(--hover); }
td.mut { color: var(--text2); font-variant-numeric: tabular-nums; }
th.r, td.r { text-align: right; }
td.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; letter-spacing: 0; color: var(--text2); }

/* ---------- lists ---------- */
.li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.li:hover { background: var(--hover); }
.li-t { min-width: 0; line-height: 1.3; white-space: nowrap; }
.li-t b { font-size: 14px; font-weight: 600; display: block; }
.li-t span { font-size: 13px; color: var(--text2); }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; letter-spacing: 0; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-crit { color: var(--crit); background: var(--crit-bg); }
.t-warn { color: var(--warn); background: var(--warn-bg); }
.t-good { color: var(--good); background: var(--good-bg); }
.t-info { color: var(--info); background: var(--info-bg); }
.t-gray { color: var(--gray); background: var(--gray-bg); }

/* ---------- page not built yet ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 55vh; white-space: nowrap; }
.empty .sq { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 8px; }
.empty .sq .ic { width: 32px; height: 32px; stroke-width: 1.9; }
.empty b { font-size: 20px; font-weight: 700; }
.empty span { font-size: 14px; color: var(--text2); }

/* ---------- page tools (top right) ---------- */
.t-search { display: flex; align-items: center; gap: 7px; height: 36px; width: 200px; padding: 0 12px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); color: var(--text3); }
.t-search .ic { width: 16px; height: 16px; }
.t-search input { border: 0; outline: 0; background: none; width: 100%; font-size: 14px; }
.t-search input::placeholder { color: var(--text3); }
.tools .icon-btn { background: var(--surface); box-shadow: var(--shadow); width: 36px; height: 36px; border-radius: 10px; }

/* ---------- dashboard ---------- */
.row1 { margin-bottom: 16px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px; }
td.unit b { font-weight: 600; }
td.unit span { color: var(--text2); margin-left: 8px; }
.list { padding: 0 0 8px; }
.list .li { cursor: pointer; }
.li-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.li-ic .ic { width: 18px; height: 18px; }
.li .pill { margin-left: auto; }
.chev { width: 16px; height: 16px; color: var(--text3); }
.fleet { padding: 0 20px 20px; }
.fleet-v { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 14px; white-space: nowrap; }
.fleet-v b { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.fleet-v span { color: var(--text2); font-size: 14px; }
.fleet .legend { margin-top: 18px; }
.chart { padding: 6px 20px 18px; }

/* ---------- charts (js/charts.js) ---------- */
.f-crit { background: var(--crit-fill); } .f-warn { background: var(--warn-fill); } .f-good { background: var(--good-fill); }
.f-info { background: var(--info-fill); } .f-gray { background: var(--gray-fill); }
.bars { display: flex; gap: 10px; height: var(--h, 150px); }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.bar-plot { flex: 1; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--sep); }
.bar { width: min(26px, 72%); background: var(--info-fill); border-radius: 4px 4px 0 0; position: relative; }
.bar b { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--text); }
.bar-col > span { font-size: 11px; color: var(--text3); text-align: center; white-space: nowrap; }
.stack { display: flex; gap: 2px; height: 12px; }
.stack .sk { min-width: 6px; height: 100%; }
.stack .sk:first-child { border-radius: 6px 0 0 6px; }
.stack .sk:last-child { border-radius: 0 6px 6px 0; }
.legend { display: grid; gap: 10px; }
.lg-row { display: flex; align-items: center; gap: 10px; font-size: 14px; white-space: nowrap; }
.lg-row .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg-row b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- slide-in panel (FB.panel in js/app.js) ---------- */
.main { transition: margin-right .25s ease; }
body.panel-open .main { margin-right: 500px; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 500px; z-index: 50; background: var(--surface); border-left: 1px solid var(--sep); box-shadow: -12px 0 40px rgba(0, 0, 0, .08); transform: translateX(100%); transition: transform .25s ease; }
body.panel-open .panel { transform: none; }
.panel form, .panel .panel-in { height: 100%; display: flex; flex-direction: column; }
.panel-h { display: flex; align-items: flex-start; padding: 22px 16px 10px 20px; }
.panel-sub { font-size: 13px; color: var(--text2); margin-top: 4px; white-space: nowrap; }
.panel-h h2 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.02em; white-space: nowrap; }
.panel-h .x { margin-left: auto; }
.panel-b { flex: 1; overflow-y: auto; padding: 8px 20px 20px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-content: start; }
.panel-b > .field { grid-column: 1 / -1; }
.panel-b > .field.half { grid-column: span 3; }
.panel-b > .field.third { grid-column: span 2; }
.panel-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--sep); }
.panel-f .danger { margin-right: auto; color: var(--crit); }
.panel-f .danger.sure { background: var(--crit-fill); color: #fff; }
.vt.clickable tbody tr { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.field > input, .field > textarea, .field > select { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid transparent; background: var(--fill); font-size: 14px; outline: none; }
.field textarea { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.4; }
.field > input:focus, .field > textarea:focus, .field > select:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field .err { font-size: 12px; color: var(--crit); }
.field .err:empty { display: none; }
.panel-b > .form-msg { grid-column: 1 / -1; font-size: 13px; color: var(--crit); background: var(--crit-bg); border-radius: 8px; padding: 8px 10px; white-space: nowrap; overflow-x: auto; }
.panel-b > .form-msg:empty { display: none; }
.field.bad > input, .field.bad > textarea, .field.bad .svc { border-color: var(--crit); }

/* Service Type check-box list (js/vehicles.js servicesField) */
.svc { border-radius: 12px; background: var(--fill); border: 1px solid transparent; }
.svc-row { padding: 0 12px; }
.svc-row + .svc-row { border-top: 1px solid var(--sep); }
.svc-name { display: flex; align-items: center; gap: 9px; height: 38px; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.svc-opts { display: none; gap: 8px; padding: 0 0 10px 25px; }
.svc-row.on .svc-opts { display: flex; }
.svc-opt { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: 8px; background: var(--surface); font-size: 13px; white-space: nowrap; cursor: pointer; }
.svc-opt select, .svc-opt input[type="number"] { height: 26px; border: 0; background: transparent; font-size: 13px; outline: none; padding: 0 2px; color: var(--text); }
.svc-opt input[type="number"] { width: 64px; }
.svc-opt span { color: var(--text2); }
.svc input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; cursor: pointer; }
td .int { color: inherit; font-size: inherit; }

/* number boxes: no up / down arrows */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.table-card { padding-top: 8px; }
tr.new td { animation: flash 2.4s ease; }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, var(--accent) 18%, transparent); } }
@media (max-width: 900px) { body.panel-open .main { margin-right: 0; } .panel { width: 100%; } }

/* ---------- hover labels ---------- */
[data-tip] { position: relative; }
[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: rgba(28, 28, 30, .94); color: #fff; font: 500 12px/1.2 var(--font); letter-spacing: 0; pointer-events: none; z-index: 60; }

/* ---------- small windows and phones: the side menu becomes icons only ---------- */
@media (max-width: 1180px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .row2, .row3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .side { width: 68px; padding: 14px 10px; }
  .brand-t, .s-search, .grp, .item > span:not(.sq), .who { display: none; }
  .brand { justify-content: center; padding: 4px 0 12px; }
  .item { justify-content: center; padding: 0; height: 40px; }
  .foot { flex-direction: column; gap: 6px; padding: 10px 0 0; } .foot .icon-btn { margin-left: 0; }
  .item:hover::after { content: attr(data-label); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: rgba(28, 28, 30, .94); color: #fff; font: 500 12px/1.2 var(--font); z-index: 60; }
  .item { position: relative; }
  .main { padding: 20px 16px 60px; }
  .top { flex-wrap: wrap; } .tools { margin-left: 0; }
}
@media (max-width: 600px) { .stats { grid-template-columns: minmax(0, 1fr); } h1 { font-size: 28px; } .t-search { display: none; } }

/* ---------- Service History (js/vehicles.js, Build 42) ---------- */
.hist-ic { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: 6px; color: var(--accent); font: inherit; }
.hist-ic:hover { background: var(--fill); }
.hist-ic .ic { width: 16px; height: 16px; }
.hist-ic span { color: var(--text2); }
.panel-b.view { display: block; }
.hist { padding-top: 4px; }
.h-item { position: relative; padding: 0 0 20px 24px; }
.h-item::before { content: ""; position: absolute; left: 2px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.h-item::after { content: ""; position: absolute; left: 6px; top: 18px; bottom: 2px; width: 1px; background: var(--sep); }
.h-item:last-child::after { display: none; }
.h-top { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.h-top b { font-size: 14px; }
.h-top span { margin-left: auto; font-size: 12px; color: var(--text2); }
.h-svcs { display: flex; gap: 6px; margin: 8px 0 6px; white-space: nowrap; overflow-x: auto; }
.h-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--info-bg); color: var(--info); white-space: nowrap; }
.h-chip.other { background: var(--gray-bg); color: var(--gray); }
.h-det { font-size: 13px; white-space: pre; overflow-x: auto; }
.h-by { font-size: 12px; color: var(--text2); margin-top: 4px; white-space: nowrap; }
.h-empty { color: var(--text3); padding: 8px 0; }

/* Next Due block at the top of Service History (Build 43) */
.h-sec { font-size: 12px; font-weight: 700; color: var(--text2); margin: 4px 0 8px; white-space: nowrap; }
.nd { border-radius: 12px; background: var(--fill); margin-bottom: 18px; overflow-x: auto; }
.nd-row { display: grid; grid-template-columns: auto auto auto auto; justify-content: start; column-gap: 14px; align-items: center; padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
.nd-row + .nd-row { border-top: 1px solid var(--sep); }
.nd-name { font-weight: 700; }
.nd-last, .nd-due { color: var(--text2); }
.nd .pill { height: 20px; padding: 0 8px; font-size: 11.5px; }
.h-edit { width: 24px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text3); flex: none; }
.h-edit:hover { background: var(--fill); color: var(--accent); }
.h-edit .ic { width: 14px; height: 14px; }

/* ---------- Settings (pages/settings.js, Builds 47-48) ---------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px; align-items: start; }
.set-card { padding-bottom: 18px; }
.set-list { margin: 0 20px; border-radius: 12px; background: var(--fill); }
.set-row { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 6px 0 12px; font-size: 13px; white-space: nowrap; }
.set-row + .set-row { border-top: 1px solid var(--sep); }
.set-row span { flex: 1; }
.set-del { height: 28px; min-width: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--text3); padding: 0 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.set-del:hover { background: var(--hover); color: var(--crit); }
.set-del .ic { width: 15px; height: 15px; }
.set-del.sure { background: var(--crit-fill); color: #fff; padding: 0 10px; }
.set-add { display: flex; gap: 8px; margin: 12px 20px 0; }
.set-add input, .set-num input { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid transparent; background: var(--fill); outline: none; font-size: 13px; }
.set-add input { flex: 1; min-width: 0; }
.set-add input:focus, .set-num input:focus { border-color: var(--accent); background: var(--surface); }
.set-err { margin: 6px 20px 0; font-size: 12px; color: var(--crit); }
.set-err:empty { display: none; }
.set-num { cursor: text; }
.set-num input { width: 120px; height: 30px; text-align: left; }
.set-soon .set-add { justify-content: flex-end; }

/* ---------- Photos & Receipts (js/files.js, Build 50) ---------- */
.h-att { display: flex; gap: 8px; margin: 8px 0 2px; white-space: nowrap; overflow-x: auto; padding-bottom: 2px; }
.att-thumb { position: relative; width: 56px; height: 56px; flex: none; border-radius: 10px; overflow: hidden; background: var(--fill); border: 1px solid var(--sep); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; flex: none; border-radius: 9px; background: var(--fill); font-size: 12px; color: var(--text); white-space: nowrap; }
.att-chip .ic { width: 15px; height: 15px; color: var(--crit); }
.att-x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: rgba(28, 28, 30, .85); color: #fff; display: grid; place-items: center; }
.att-x .ic { width: 10px; height: 10px; stroke-width: 2.6; }
.att .att-list { overflow: visible; padding-top: 6px; }
.att .att-list:empty { display: none; }
.att-add { margin-top: 6px; cursor: pointer; box-shadow: none; background: var(--fill); }
.att-add .ic { width: 16px; height: 16px; }
.att-busy { font-size: 12px; color: var(--text2); }
.panel-f .btn-primary:disabled { opacity: .5; cursor: default; }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .86); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; cursor: zoom-out; padding: 24px; }
.lightbox img { max-width: 100%; max-height: calc(100% - 40px); border-radius: 10px; }
.lb-name { color: #fff; font-size: 13px; white-space: nowrap; }

/* shows when a change could not be written to the Desktop folder (Build 51) */
html.not-saved body::after { content: "Not saved"; position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 400; padding: 6px 14px; border-radius: 999px; background: var(--crit-fill); color: #fff; font: 700 12px var(--font); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }

/* ---------- Driver File panel (js/drivers.js, Builds 54-58) ---------- */
.df .h-att { margin-bottom: 18px; }
.df-grid { border-radius: 12px; background: var(--fill); margin-bottom: 18px; }
.df-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
.df-row + .df-row { border-top: 1px solid var(--sep); }
.df-row span { color: var(--text2); width: 150px; flex: none; }
.df-row b { font-weight: 600; }
.df .h-empty { margin-bottom: 14px; }
.end-row { display: flex; gap: 8px; }
.end { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--fill); font-size: 13px; font-weight: 700; cursor: pointer; }
.end input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.link-btn { color: var(--accent); font: inherit; font-weight: 700; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- DVIR checklist (js/dvir.js, Build 64) ---------- */
.dv { border-radius: 12px; background: var(--fill); padding-bottom: 4px; }
.dv-sec { font-size: 11px; font-weight: 700; color: var(--text2); padding: 10px 12px 4px; white-space: nowrap; }
.dv-row { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 8px 0 12px; font-size: 13px; white-space: nowrap; }
.dv-row + .dv-row { border-top: 1px solid var(--sep); }
.dv-row > span { flex: 1; min-width: 0; }
.dv-row.bad { background: var(--crit-bg); }
.dv-row.bad > span { color: var(--crit); font-weight: 700; }
.dv-seg { display: flex; padding: 2px; border-radius: 8px; background: var(--surface); flex: none; }
.dv-seg label { cursor: pointer; }
.dv-seg input { position: absolute; opacity: 0; pointer-events: none; }
.dv-seg b { display: block; height: 26px; line-height: 26px; padding: 0 12px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--text2); }
.dv-seg input[value="ok"]:checked + b { background: var(--good-fill); color: #fff; }
.dv-seg input[value="defect"]:checked + b { background: var(--crit-fill); color: #fff; }
.set-tag { font-size: 10px; font-weight: 700; color: var(--accent); background: var(--info-bg); border-radius: 6px; padding: 2px 6px; }

/* ---------- tabs at the top of a page (Inspection Log, Build 67) ---------- */
.tabs-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--fill); margin-bottom: 16px; }
.tabs-seg button { height: 32px; padding: 0 16px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--text2); white-space: nowrap; }
.tabs-seg button:hover { color: var(--text); }
.tabs-seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.tab-body .empty { min-height: 45vh; }

/* ---------- base tabs above a list (Build 79, from CleanTech) ---------- */
.btabs { overflow-x: auto; max-width: 100%; }
.btabs .tabs-seg { margin-bottom: 12px; }

/* ---------- Maintenance box in the vehicle panel (Build 81, from CleanTech) ---------- */
.vm { border: 1px solid var(--sep); border-radius: 10px; padding: 4px 12px; overflow-x: auto; }
.vm-row { display: grid; gap: 2px; white-space: nowrap; padding: 6px 0; font-size: 13px; }
.vm-row + .vm-row { border-top: 1px solid var(--sep); }
.vm-k { font-size: 12px; font-weight: 700; color: var(--text2); }
.vm-v { color: var(--text2); overflow-x: auto; }
.crit-txt { color: var(--crit); }
.set-add select { height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid transparent; background: var(--fill); font-size: 13px; color: var(--text); }
.h-top .h-no { font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); }

/* ---------- filters above a list (Work Log, Build 85) ---------- */
.wf { overflow-x: auto; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; white-space: nowrap; }
.filters select { flex: none; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid transparent; background: var(--fill); font-size: 13px; font-weight: 700; color: var(--text2); }
.filters select.on { background: var(--info-bg); color: var(--accent); }

/* ---------- progress bar (Build 86, from CleanTech) ---------- */
.pbar { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; vertical-align: middle; }
.pbar i { display: block; height: 100%; border-radius: 3px; }
.pbar .b-good { background: var(--good-fill); } .pbar .b-warn { background: var(--warn-fill); } .pbar .b-crit { background: var(--crit-fill); }
.panel-b > .field[hidden] { display: none; }

/* ---------- driver warnings (Build 91, from CleanTech) ---------- */
.t-orange { color: #c93400; background: rgba(255, 94, 0, .14); }
:root[data-theme="dark"] .t-orange { color: #ff9f5a; background: rgba(255, 120, 40, .2); }
.hist-ic.warn-on { color: var(--crit); }
.sig { position: relative; }
.sig canvas { display: block; width: 100%; height: 120px; background: #fff; border: 1px solid var(--sep); border-radius: 10px; touch-action: none; cursor: crosshair; }
.sig-clear { position: absolute; right: 8px; top: 8px; font-size: 12px; font-weight: 700; color: #636366; background: rgba(118, 118, 128, .12); border-radius: 7px; padding: 3px 8px; }
.w-btns { display: flex; gap: 8px; margin-top: 8px; }
.w-btns .btn { height: 28px; padding: 0 10px; font-size: 12px; } .w-btns .btn .ic { width: 14px; height: 14px; }
.h-item.w-gone .h-det, .h-item.w-gone .h-top b { color: var(--text3); text-decoration: line-through; }

/* ---------- Expenses (Build 92, from CleanTech) ---------- */
.tab-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; line-height: 18px; text-align: center; color: #fff; }
.tab-n.crit { background: var(--crit-fill); } .tab-n.warn { background: var(--warn-fill); }
.ex-total { display: flex; justify-content: flex-end; gap: 16px; padding: 10px 16px 4px; font-size: 13px; color: var(--text2); white-space: nowrap; }
.ex-total b { color: var(--text); }

/* ---------- Parts (Build 94, from CleanTech) ---------- */
.tab-c { font-size: 11px; font-weight: 600; color: var(--text3); margin-left: 4px; }
.pt tr.cat-band td { color: #fff; font-family: var(--font-ui, inherit); font-weight: 800; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; height: 28px; }
.pt tr.cat-band:hover td { filter: none; }
.fit { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--fill); color: var(--text2); margin-right: 4px; }
.warn-txt { color: var(--warn); }
.fits-row { flex-wrap: nowrap; overflow-x: auto; }
.ph table { font-size: 12px; } .ph td { height: 26px; font-size: 12px; } .ph th { font-size: 11px; }
.fits-row .end { padding: 0 9px; font-size: 12px; gap: 0; flex: none; }
.fits-row .end input { position: absolute; opacity: 0; width: 0; height: 0; }
.fits-row .end:has(input:checked) { background: var(--accent); color: #fff; }

/* Receive lines / Parts Used lines (Builds 95, 98) */
.pu-list { display: grid; gap: 6px; }
.rc-row, .pu-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 90px 28px; gap: 6px; align-items: center; }
.rc-row select, .rc-row input, .pu-row select, .pu-row input { height: 34px; min-width: 0; padding: 0 8px; border-radius: 9px; border: 1px solid transparent; background: var(--fill); font-size: 13px; color: var(--text); }
.pu-cost { font-size: 12.5px; color: var(--text2); text-align: right; white-space: nowrap; font-family: var(--mono); }
.pu-x { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--text3); }
.pu-x:hover { background: var(--fill); color: var(--crit); } .pu-x .ic { width: 14px; height: 14px; }
.pu-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; white-space: nowrap; }
.pu-add { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--accent); } .pu-add .ic { width: 14px; height: 14px; }
.pu-total { font-size: 13px; color: var(--text2); } .pu-total b { color: var(--text); margin-left: 6px; }
.tools .btn:disabled { opacity: .45; cursor: default; }

/* Count (Build 97) */
.ct-list { display: grid; gap: 4px; }
.ct-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 90px; gap: 8px; align-items: center; font-size: 13px; white-space: nowrap; }
.ct-row > span:first-child { overflow-x: auto; }
.ct-row.ct-h { font-size: 11px; font-weight: 700; color: var(--text2); }
.ct-row input { height: 32px; min-width: 0; padding: 0 8px; border-radius: 9px; border: 1px solid transparent; background: var(--fill); font-size: 13px; color: var(--text); }

/* Vehicle documents (Build 101) */
.hist-ic.doc-warn { color: var(--warn); } .hist-ic.doc-crit { color: var(--crit); }

/* ---------- Pulse (Build 104, design B "Widgets") ---------- */
.pl-tabs .tabs-seg { margin-bottom: 0; }
.pl-grid { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; }
.pl-w { display: flex; flex-direction: column; gap: 4px; min-height: 150px; padding: 16px 18px; border-radius: 18px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; outline: none; }
.pl-w:hover, .pl-w:focus-visible { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 10px 30px rgba(0, 0, 0, .08); }
.pl-w2 { grid-column: span 2; grid-row: span 2; }
.pl-ch { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; white-space: nowrap; }
.pl-ch h3 { margin: 0; font-size: 13px; font-weight: 700; }
.pl-ch .sq { width: 26px; height: 26px; border-radius: 8px; }
.pl-ch .sq .ic { width: 15px; height: 15px; }
.pl-more { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--accent); }
.pl-big { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; white-space: nowrap; }
.pl-big small { font-size: 13px; font-weight: 700; color: var(--text2); letter-spacing: 0; margin-left: 6px; }
.pl-sub { font-size: 12px; color: var(--text2); white-space: nowrap; overflow-x: auto; }
.pl-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--fill); margin-top: auto; }
.pl-bar i { display: block; height: 100%; }
.pl-chips { display: flex; gap: 6px; margin-top: auto; white-space: nowrap; overflow-x: auto; }
.pl-chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pl-due { display: grid; }
.pl-due-r { display: grid; grid-template-columns: 84px 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--sep); font-size: 12.5px; white-space: nowrap; }
.pl-due-r:first-child { border-top: 0; }
.pl-due-r .pl-chip { justify-self: start; }
.pl-due-r > span:nth-child(3) { overflow-x: auto; }
html.stale body::after { content: "Changed in another window · reload this page"; position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 401; padding: 6px 14px; border-radius: 999px; background: var(--warn-fill); color: #fff; font: 700 12px var(--font); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); white-space: nowrap; }
.job-link { cursor: pointer; } .job-link:hover { text-decoration: underline; }

/* ---------- sign-in (Build 123, the look of AM6's CleanTech sign-in card) ---------- */
html.gated .side, html.gated .main { display: none; }
#gate { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #071a4a, #0d2b78); font-family: var(--font-ui); }
.lg-card { width: 380px; max-width: 100%; background: #fff; color: #1a1916; border-radius: 16px; padding: 28px 28px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.lg-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px; }
.lg-logo { width: 44px; height: 44px; border-radius: 12px; background: #007aff; color: #fff; display: grid; place-items: center; flex: none; }
.lg-logo svg { width: 26px; height: 26px; }
.lg-name { font: 800 28px/1 var(--font-ui); letter-spacing: -0.04em; white-space: nowrap; color: #0c1430; }
.lg-card h2 { text-align: center; font-size: 16px; font-weight: 600; margin: 0 0 2px; }
.lg-card .sub { text-align: center; color: #9b9890; font-size: 12px; margin-bottom: 18px; min-height: 18px; }
.lg-card .sub b { color: #1a1916; font-weight: 600; }
.lg-card label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: #6b6860; font-weight: 600; margin: 10px 0 4px; }
.lg-card input { font: 13px var(--font-ui); padding: 8px 10px; border: 1px solid #e5e3db; border-radius: 8px; background: #fff; color: #1a1916; width: 100%; outline: none; }
.lg-card input:focus { border-color: #007aff; }
.lg-ro { font-size: 13px; padding: 8px 10px; border: 1px solid #e5e3db; border-radius: 8px; background: #f3f1ea; color: #6b6860; overflow-x: auto; white-space: nowrap; }
.lg-card button { display: flex; width: 100%; justify-content: center; margin-top: 14px; padding: 10px; border-radius: 8px; font: 600 13px var(--font-ui); cursor: pointer; border: 1px solid #007aff; background: #007aff; color: #fff; }
.lg-card button:disabled { opacity: .6; cursor: default; }
.lg-err { color: #b83225; font-size: 12.5px; margin-top: 10px; min-height: 16px; }
.lg-sb { color: #1a1916; font-size: 15px; font-weight: 600; text-align: center; margin: 8px 0 4px; line-height: 1.45; }
.lg-links { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; }
.lg-links a { color: #007aff; cursor: pointer; font-weight: 600; }
.lg-open { text-align: center; font-size: 14px; font-weight: 600; margin-top: 6px; }
.lg-bar { height: 6px; border-radius: 999px; background: #e5e3db; overflow: hidden; margin-top: 18px; position: relative; }
.lg-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 999px; background: #007aff; animation: lg-go 1.3s ease-in-out infinite alternate; }
@keyframes lg-go { from { left: 0; } to { left: 60%; } }
/* Sign out pill at the bottom of the side menu (red on hover, asks once) */
.signout { margin: 10px 8px 0; height: 30px; border-radius: 999px; border: 1px solid var(--sep); background: transparent; color: var(--text2); font: 700 12px var(--font-ui); cursor: pointer; white-space: nowrap; }
.signout:hover, .signout.sure { border-color: var(--crit-fill); color: #fff; background: var(--crit-fill); }
/* a short message at the top (Not saved - that belongs to ...) */
#toast { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -80px); z-index: 402; padding: 8px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font: 700 12.5px var(--font-ui); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); white-space: nowrap; transition: transform .25s ease; }
#toast.on { transform: translate(-50%, 0); }

/* ---------- Users (Build 124, AM6's Users page, option A: one colour for the modules) ---------- */
.us-card { border-left: 4px solid var(--accent); }
.us-h { display: flex; align-items: baseline; gap: 12px; padding: 8px 12px 12px; white-space: nowrap; }
.us-h h2 { margin: 0; font-size: 16px; }
.us-h .mut { font-size: 12px; }
.us-t td.c, .us-t th.c { text-align: center; }
.us-t td { height: 52px; }
.us-who { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.us-who .av { width: 32px; height: 32px; }
.us-who .link-btn { font-weight: 700; color: var(--accent); }
.us-you { font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--info-bg); border-radius: 6px; padding: 1px 6px; }
.us-sub { display: block; font-size: 11.5px; color: var(--text2); margin-top: 1px; }
.us-sub.us-inv { color: #b45309; }
.us-pill { width: 38px; height: 26px; border-radius: 999px; border: 1px solid var(--sep); background: var(--surface); display: inline-grid; place-items: center; color: #fff; cursor: pointer; }
.us-pill.on { background: var(--accent); border-color: var(--accent); }
.us-pill.locked { background: var(--accent); border-color: var(--accent); cursor: not-allowed; }
.us-pill .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.us-act { min-width: 98px; height: 26px; border-radius: 999px; font: 700 12px var(--font-ui); border: 0; cursor: pointer; background: var(--gray-bg); color: var(--gray); white-space: nowrap; }
.us-act.on { background: #22c55e; color: #fff; box-shadow: 0 0 10px rgba(34, 197, 94, .45); }
.us-act.sure { background: var(--crit-fill); color: #fff; box-shadow: none; }
.us-act.locked { cursor: not-allowed; }
tr.us-off td { opacity: .55; }
.us-link { font-size: 12.5px; padding: 10px 12px; border-radius: 10px; background: var(--fill); overflow-x: auto; white-space: nowrap; user-select: all; }
.us-sign { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.us-ro { font-family: var(--font); }
.signout[hidden] { display: none; }
