/* Fleet Manager: maintenance tracker */

:root {
  /* Red, white and blue from the Gulf Coast Crating and XLR8 logos; charcoal sidebar */
  --charcoal-900: #252424;
  --charcoal: #3b3a3a;
  --charcoal-700: #4a4949;
  --navy: #242b7a;
  --navy-500: #3a43a3;
  --navy-soft: #e7e9f5;
  --navy-tint: #b3b8e3;
  --navy-700: #1b2160;
  --red: #ed1c2b;
  --red-soft: #fde2e4;
  --due: #f26b74;
  --due-soft: #fde2e4;
  --due-ink: #a8111d;
  --sand: #e7e6e4;
  --tan: #c6c6c6;
  --brown: #3b3a3a;
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --ink: #1c1c1c;
  --ink-2: #3b3a3a;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --line: #dcdcde;
  --line-strong: #bdbdc0;
  --focus: #3a43a3;

  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 8px;
  --radius-sm: 5px;

  --sidebar-w: 256px;
  --rail-w: 340px;
  --topbar-h: 60px;

  --font: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow-pop: 0 12px 40px rgba(28, 28, 28, 0.16), 0 2px 6px rgba(28, 28, 28, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 26px; height: 26px; }

/* ---------- Shell ---------- */

.app {
  background: linear-gradient(90deg, var(--charcoal) 0 var(--sidebar-w), var(--bg) var(--sidebar-w));
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--charcoal);
  display: flex; flex-direction: column;
  padding: 18px 12px 18px;
  overflow-y: auto;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 4px 8px 26px;
  text-decoration: none; color: #fff;
}
.lockup { display: inline-flex; flex-direction: column; align-items: center; gap: 16px; }
.lockup-logos { display: flex; align-items: center; gap: 22px; }
.lockup-tag {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; line-height: 1.6;
  color: #fff; padding-left: 0.3em; /* balance trailing letter-spacing */
}
.brand-mark { width: 60px; height: 60px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.brand-xlr8 { height: 58px; width: auto; flex: none; }
.app.collapsed .brand-mark { width: 44px; height: 44px; }
.app.collapsed .brand-xlr8, .app.collapsed .lockup-tag { display: none; }
.login-art .lockup { gap: 22px; }
.login-art .lockup-logos { gap: 32px; }
.login-art .brand-mark { width: 88px; height: 88px; }
.login-art .brand-xlr8 { height: 86px; }
.login-art .lockup-tag { font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item, .nav-sub a {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px;
  border-radius: 2px;
  text-decoration: none;
  color: #ececec;
  font-weight: 700; font-size: 13.5px; letter-spacing: 0.07em; text-transform: uppercase;
  background: none; border: 0; cursor: pointer; width: 100%; text-align: left;
}
.nav-item .chev { margin-left: auto; transition: transform .2s ease; }
.nav-item[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-item:hover, .nav-sub a:hover { background: var(--charcoal-700); }
.nav-item.active, .nav-sub a.active { background: var(--charcoal-900); color: #fff; box-shadow: inset 4px 0 0 var(--red); }
.nav-sub a { color: #c9c9c9; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px; }
.nav-sub a { padding: 10px 14px 10px 46px; font-size: 13px; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; display: flex; justify-content: flex-end; }
.collapse-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--red); color: #fff; display: grid; place-items: center;
}
.collapse-btn:hover { background: #c81421; }

.app.collapsed { --sidebar-w: 76px; }
.app.collapsed .nav-label, .app.collapsed .chev, .app.collapsed .nav-sub { display: none; }
.app.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.app.collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.app.collapsed .sidebar-foot { justify-content: center; }
.app.collapsed .collapse-btn svg { transform: rotate(180deg); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px 0 28px;
}
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--charcoal); min-width: 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--faint); }
.crumbs .current { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; }
.top-actions > * + * { border-left: 1px solid var(--line); }
.top-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 18px; font-weight: 600; color: var(--charcoal);
  background: none; border: 0; cursor: pointer; text-decoration: none; position: relative;
}
.top-link:hover { color: var(--navy-500); }
.top-link .dot {
  position: absolute; top: -5px; left: 26px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; box-shadow: 0 0 0 2px var(--surface);
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

.content { flex: 1; display: flex; min-width: 0; }
.page { flex: 1; min-width: 0; padding: 30px 28px 64px; }
.rail {
  width: var(--rail-w); flex: none;
  background: var(--surface);
  border-left: 1px solid var(--line);
  min-height: calc(100vh - var(--topbar-h));
}
.rail-section { padding: 26px 26px 30px; border-bottom: 1px solid var(--line); }
.rail-section:last-child { border-bottom: 0; }
.rail-title { font-size: 21px; font-weight: 700; margin-bottom: 20px; }
.rail-title.quiet { font-size: 19px; color: var(--ink-2); }

/* ---------- Page headers ---------- */

.page-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.page-head .spacer { flex: 1; }
.count {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 30px; padding: 0 10px; border-radius: 15px;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 16px;
}
.count.sm { min-width: 26px; height: 24px; font-size: 14px; }
.section-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 22px; font-weight: 700; }

/* ---------- Controls ---------- */

.input, .select, textarea.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input { height: auto; min-height: 88px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus { border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(58, 67, 163, .22); }
.input.valid { border-color: var(--navy-500); }
.input.invalid { border-color: var(--red); }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3E%3Cpath d='M0 0h14L7 8z' fill='%231c1d1a'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.select.sm, .input.sm { height: 38px; font-size: 14px; }
.search { position: relative; flex: 1; max-width: 470px; min-width: 200px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); width: 20px; height: 20px; }
.search .input { padding-left: 46px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); }
.req { color: var(--red); margin-left: 2px; }
.unit-input { position: relative; }
.unit-input .input { padding-right: 42px; }
.unit-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }

.check { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.check input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 21px; height: 21px; margin: 0; border: 1.5px solid var(--line-strong); border-radius: 4px; background: #fff; display: grid; place-items: center; cursor: pointer; }
.check input[type=checkbox]:checked { background: var(--navy); border-color: var(--navy); }
.check input[type=checkbox]:checked::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.radio { appearance: none; -webkit-appearance: none; width: 21px; height: 21px; margin: 0; border-radius: 50%; border: 1.5px solid var(--muted); background: #fff; display: grid; place-items: center; flex: none; cursor: pointer; }
.radio:checked { border-color: var(--navy); background: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.radio:checked::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--charcoal);
  background: var(--surface);
  color: var(--charcoal);
  font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--navy-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-700); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-plain {
  border: 0; background: none; height: auto; padding: 6px 4px; color: var(--charcoal);
}
.btn-plain:hover { background: none; color: var(--navy-500); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 56px; padding: 0 30px; }
.btn-text {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  font-weight: 700; color: var(--charcoal); text-decoration: none; font-size: 15px;
}
.btn-text:hover { color: var(--navy-500); }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; color: var(--charcoal);
}
.icon-btn:hover { background: var(--navy-soft); }
.icon-btn.active { background: var(--navy-soft); outline: 1px solid var(--navy-500); }

.split { display: inline-flex; }
.split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; padding: 0 26px; }
.split .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 1px; padding: 0 10px; }
.split .btn-primary:last-child { border-left: 1px solid rgba(43, 42, 42, .25); }

.segmented { display: inline-flex; border: 1.5px solid var(--charcoal); border-radius: var(--radius-md); overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.segmented button, .segmented a {
  border: 0; background: var(--surface); padding: 11px 26px; cursor: pointer; text-decoration: none;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; color: var(--charcoal);
}
.segmented .on { background: var(--navy); color: #fff; }

.option-list { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  height: 52px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 16px;
}
.option:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.option input { flex: none; }

/* ---------- Surfaces ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 2px rgba(28, 29, 26, .04);
}
.card-pad { padding: 30px 34px; }
.stack { display: flex; flex-direction: column; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }

.panel-sand {
  background: var(--sand); border-radius: var(--radius-xl); padding: 30px 36px;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}
.panel-sand h2 { font-size: 22px; margin-bottom: 14px; }
.panel-sand ul { margin: 0; padding-left: 26px; line-height: 1.95; font-size: 16px; }
.panel-sand > div:first-child { flex: 1 1 320px; }
.panel-sand .tiles { flex: 1 1 560px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel-sand .tile { width: auto; }

.tiles { display: flex; gap: 22px; flex-wrap: wrap; }
.tile {
  width: 200px; height: 158px; border-radius: var(--radius-lg);
  padding: 22px 24px; display: flex; flex-direction: column; justify-content: space-between;
  text-decoration: none; border: 0; cursor: pointer; text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; font-weight: 700; font-size: 17px; }
.tile-num { font-size: 42px; font-weight: 400; line-height: 1; }
.tile.overdue { background: var(--red); color: #fff; }
.tile.due { background: #fff; color: var(--due-ink); box-shadow: inset 0 0 0 2px var(--due); }
.tile.not_due { background: var(--navy); color: #fff; }
.tile.selected { outline: 3px solid var(--charcoal); outline-offset: 3px; }

.cost-card {
  background: var(--navy); color: #fff; border-radius: var(--radius-xl);
  padding: 28px 38px; display: flex; flex-direction: column; justify-content: space-between; min-height: 244px;
}
.cost-card h3 { font-size: 18px; font-weight: 700; }
.cost-card .amount { font-size: 42px; font-weight: 400; letter-spacing: -0.01em; }

/* ---------- Status pieces ---------- */

.status-label { font-weight: 700; font-size: 16px; }
.status-overdue { color: var(--red); }
.status-due { color: var(--due-ink); }
.status-not_due { color: var(--navy); }
.status-text-strong { text-transform: uppercase; font-weight: 700; letter-spacing: .01em; }
.bell { width: 22px; height: 22px; flex: none; }
.bell.overdue { color: var(--red); }
.bell.due { color: var(--due); }
.bell.not_due { color: var(--navy); }
.bell.as_needed, .bell.complete { color: var(--faint); }

.pct {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 92px; height: 24px; border-radius: 12px; overflow: hidden;
  background: #e7e7ea; font-size: 13px; font-weight: 700;
}
.pct i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--navy-tint); }
.pct span { position: relative; }
.pct.overdue { background: var(--red); color: #fff; }
.pct.overdue i { display: none; }
.pct.due i { background: var(--due); }

.chips { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 12px; border-radius: 14px;
  font-weight: 700; font-size: 14px; white-space: nowrap;
}
.chip .icon { width: 16px; height: 16px; }
.chip-date { background: var(--brown); color: #fff; }
.chip-odo { background: var(--tan); color: var(--ink); }
.chip-hrs { background: var(--navy-soft); color: var(--navy); }
.chip-overdue { background: var(--red); color: #fff; }
.chip-due { background: var(--due-soft); color: var(--due-ink); }
.chip-ok { background: var(--navy); color: #fff; }
.chip-muted { background: #ececef; color: var(--ink-2); font-weight: 600; }

.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.tag-active { background: var(--navy-soft); color: var(--navy); }
.tag-out_of_service { background: var(--red-soft); color: #a8261f; }
.tag-inactive { background: #ececef; color: var(--muted); }
.tag-overdue { background: var(--red); color: #fff; }
.tag-due { background: var(--due-soft); color: var(--due-ink); }
.tag-not_due { background: var(--navy); color: #fff; }
.tag-none { background: #ececef; color: var(--muted); }

.meters { display: flex; gap: 38px; color: var(--ink-2); font-size: 16px; }
.meters span { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.meters .icon { width: 22px; height: 22px; color: var(--muted); }

/* ---------- Maintenance status board ---------- */

.plan-group { padding: 34px 50px 24px 58px; }
.plan-group + .plan-group { margin-top: 26px; }
.plan-group h3 { font-size: 22px; font-weight: 400; }
.plan-group h3 a { text-decoration: none; }
.plan-group h3 a:hover { text-decoration: underline; }
.plan-sub { color: var(--muted); font-size: 16px; margin-top: 8px; }
.asset-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1.25fr) minmax(0, 1fr) 40px auto;
  gap: 8px 22px; align-items: start;
  padding: 26px 0 20px;
  position: relative;
}
.asset-row + .asset-row { border-top: 1px solid var(--line); }
.asset-thumb { width: 100px; height: 64px; display: grid; place-items: center; }
.asset-thumb img { width: 100px; height: 64px; object-fit: cover; border-radius: 4px; }
.asset-thumb svg { width: 100px; height: auto; }
.asset-name { font-weight: 700; font-size: 16px; text-decoration: none; }
.unit-no { font-weight: 800; color: var(--navy); margin-right: 8px; }
a.asset-name:hover { text-decoration: underline; }
.asset-meta { color: var(--muted); font-size: 15px; line-height: 1.8; margin-top: 4px; }
.asset-row .meters { margin-top: 14px; }
.status-block { display: grid; grid-template-columns: 26px 1fr; column-gap: 12px; }
.status-block .status-caption { grid-column: 2; font-size: 15px; }
.status-block .bell { grid-row: 2; align-self: center; }
.status-block .status-value { grid-column: 2; font-size: 17px; }
.status-block.overdue .status-caption { color: var(--red); font-weight: 700; }
.status-block.overdue .status-value { color: var(--red); font-weight: 700; text-transform: uppercase; }
.expand-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; display: grid; place-items: center; margin-top: 14px;
}
.expand-btn[aria-expanded="true"] { background: #8a8a8e; }
.expand-btn svg { transition: transform .2s ease; }
.expand-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.detail-pop {
  grid-column: 2 / -1;
  justify-self: end;
  position: relative;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px 24px; margin-top: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.08);
  animation: pop-in .18s ease-out;
}
.detail-pop::before {
  content: ""; position: absolute; top: -8px; right: 176px; width: 14px; height: 14px;
  background: var(--surface-2); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.bar-chart { width: 100%; height: auto; overflow: visible; }
.bar-chart text { font-family: var(--font); }

/* ---------- Asset detail ---------- */

.asset-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 28px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.asset-bar .select { max-width: 520px; background-color: var(--surface); }
.tabs {
  display: flex; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 0 14px;
}
.tabs a {
  padding: 18px 26px; text-decoration: none; white-space: nowrap;
  font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--charcoal);
  border: 1px solid transparent; border-bottom: 0;
}
.tabs a:hover { color: var(--navy-500); }
.tabs a.on { background: var(--navy-soft); border-color: var(--navy-500); }
.tabs a .dot { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--red); color: #fff; font-size: 12px; margin-left: 8px; letter-spacing: 0; }

.asset-photo { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; position: relative; }
.asset-photo img { width: 100%; height: 100%; object-fit: cover; }
.asset-photo > svg { width: 82%; height: auto; }
.asset-photo .photo-btn { position: absolute; right: 8px; bottom: 8px; background: rgba(255,255,255,.92); }
.meter-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.meter { border-left: 4px solid var(--tan); padding-left: 14px; }
.meter.hrs { border-color: var(--navy); }
.meter .k { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.meter .v { font-weight: 700; font-size: 16px; }
.rail-cost {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy); color: #fff; padding: 26px; text-decoration: none;
}
.rail-cost .amount { font-size: 28px; }
.rail-cost:hover { background: var(--navy-500); }
.status-strip { background: var(--bg); padding: 20px 26px 22px; border-bottom: 1px solid var(--line); }
.status-strip .row { justify-content: space-between; }
.mini-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.mini-tile { height: 40px; border-radius: 4px; display: flex; align-items: center; justify-content: space-around; font-weight: 700; font-size: 17px; border: 0; cursor: pointer; }
.mini-tile.overdue { background: var(--red); color: #fff; }
.mini-tile.due { background: #fff; color: var(--due-ink); box-shadow: inset 0 0 0 2px var(--due); }
.mini-tile.not_due { background: var(--navy); color: #fff; }

.list-card { overflow: hidden; }
.list-card .list-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 30px 40px; border-bottom: 1px solid var(--line); }
.list-card .list-head h2 { font-size: 22px; }
.plan-line {
  display: grid; grid-template-columns: 110px minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, 1fr) 36px 50px auto;
  gap: 16px; align-items: center; padding: 26px 40px;
}
.plan-line + .plan-line { border-top: 1px solid var(--line); }
.plan-line .t { font-size: 22px; line-height: 1.3; }
.plan-line .d { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-line .k { font-size: 15px; }
.plan-line .v { font-size: 16px; }
.plan-line.overdue .k, .plan-line.overdue .v { color: var(--red); font-weight: 700; }
.plan-line.overdue .st { text-transform: uppercase; }
.plan-line .extra { grid-column: 2 / -1; }
.pdf-btn { display: inline-flex; flex-direction: column; align-items: center; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer; }
.pdf-btn svg { width: 22px; height: 22px; }

.log-card { padding: 32px 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 18px 40px; }
.log-card + .log-card { margin-top: 24px; }
.log-card h3 { font-size: 24px; font-weight: 400; }
.log-card .desc { color: var(--muted); margin-top: 16px; line-height: 1.8; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 20px; margin-top: 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.log-total { text-align: right; min-width: 150px; }
.log-total .k { color: var(--navy-500); font-weight: 600; }
.log-total .v { font-size: 26px; }
.log-total .split-cost { color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.7; }
.log-actions { display: flex; gap: 4px; justify-content: flex-end; margin-top: 14px; }
.readmore { font-weight: 700; color: var(--navy); background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th {
  text-align: left; font-weight: 700; font-size: 13px; color: var(--ink-2);
  padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
  position: sticky; top: 0;
}
table.data th button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: inherit; }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover td { background: #f7f7fa; }
table.data tr:last-child td { border-bottom: 0; }
table.data .thumb svg { width: 64px; height: auto; }
table.data .thumb img { width: 64px; height: 40px; object-fit: cover; border-radius: 3px; }
table.data .strong { font-weight: 700; }
table.data .right { text-align: right; }
table.data td.check-cell, table.data th.check-cell { width: 44px; padding-right: 0; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

.type-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.type-filter button {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px;
}
.type-filter button b { font-weight: 700; color: var(--muted); }
.type-filter button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.type-filter button.on b { color: #fff; }

/* ---------- Plans ---------- */

.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.plan-card { padding: 28px 30px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.plan-card h3 { font-size: 20px; font-weight: 600; }
.plan-card .desc { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-card .foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.plan-card:hover { box-shadow: 0 0 0 2px var(--navy); }

.oem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 26px; }
.oem-card { display: flex; flex-direction: column; border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.06); overflow: hidden; }
.oem-card .pic { height: 170px; display: grid; place-items: center; padding: 20px 26px 0; }
.oem-card .pic svg { width: 100%; max-width: 250px; height: auto; }
.oem-card .make { padding: 0 26px 6px; border-bottom: 1px solid var(--line); font-weight: 800; letter-spacing: .06em; color: var(--navy); font-size: 14px; text-transform: uppercase; }
.oem-card .body { padding: 18px 26px; flex: 1; }
.oem-card h3 { font-size: 20px; font-weight: 400; }
.oem-card p { color: var(--muted); margin-top: 10px; font-size: 14.5px; line-height: 1.65; }
.oem-card .interval { font-size: 13.5px; color: var(--ink-2); font-weight: 600; margin-top: 10px; }
.oem-card .foot { display: flex; align-items: center; gap: 18px; padding: 16px 26px; border-top: 1px solid var(--line); }
.added { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px; border-radius: 15px; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; }
.fleet-hint { font-size: 12.5px; font-weight: 600; color: var(--navy-500); margin-left: auto; }

.form-card { padding: 38px 40px; }
.interval-bar { display: inline-flex; border: 1px solid var(--charcoal); border-radius: 4px; overflow: hidden; flex-wrap: wrap; }
.interval-bar > button, .interval-bar > .recurring {
  border: 0; background: var(--surface); padding: 0 24px; height: 50px; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; gap: 12px;
}
.interval-bar > * + * { border-left: 1px solid var(--charcoal) !important; }
.interval-bar .recurring { padding: 0; gap: 0; }
.interval-bar .recurring > button { border: 0; height: 50px; padding: 0 24px; background: var(--surface); cursor: pointer; font-size: 16px; }
.interval-bar .on { background: var(--navy) !important; color: #fff; font-weight: 600; }
.interval-bar .sub { display: flex; align-items: center; gap: 22px; padding: 0 20px; height: 50px; background: var(--navy-soft); }
.interval-bar .sub label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.interval-help { color: var(--muted); margin-top: 18px; max-width: 660px; line-height: 1.6; }
.interval-help b { color: var(--ink-2); }

.page { container-type: inline-size; }
.interval-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); border-radius: var(--radius-xl); background: var(--surface); overflow: hidden; }
.interval-grid .left { padding: 38px 40px 26px; }
.interval-grid .right { padding: 38px 36px 26px; border-left: 1px solid var(--line); }
.interval-grid .left, .interval-grid .right { display: flex; flex-direction: column; }
.interval-grid .meter-table, .interval-grid .due-cells { margin-top: auto; }
.meter-table { display: grid; grid-template-columns: minmax(150px, 1fr) repeat(3, 150px); align-items: center; column-gap: 12px; }
.meter-table .h { font-weight: 700; color: var(--ink-2); padding: 24px 0 14px; }
.meter-row { display: contents; }
.meter-cell { padding: 20px 0; border-top: 1px solid var(--line); height: 92px; display: flex; align-items: center; }
.meter-row .meter-cell:first-child { margin-left: -40px; padding-left: 40px; }
.meter-row .meter-cell:last-child { margin-right: -40px; padding-right: 40px; }
.due-cells { display: grid; grid-template-columns: 1fr 1fr; align-items: center; column-gap: 10px; }
.due-cells .h { font-weight: 700; padding: 24px 0 14px; }
.due-cells .meter-cell:nth-child(odd) { margin-left: -36px; padding-left: 36px; }
.due-cells .meter-cell:nth-child(even) { margin-right: -36px; padding-right: 36px; }
.meter-name { font-weight: 700; font-size: 16px; letter-spacing: .02em; text-transform: uppercase; }
.meter-name.off { font-weight: 400; }

.pct-track { position: relative; height: 90px; margin: 10px 4px 0; }
.pct-track .line { position: absolute; left: 12px; right: 12px; top: 26px; height: 5px; border-radius: 3px; }
.pct-track .stop { position: absolute; top: 14px; width: 28px; height: 28px; transform: translateX(-50%); border: 0; border-radius: 50%; cursor: pointer; background: var(--navy-500); padding: 0; }
.pct-track .stop.warn { background: var(--due); }
.pct-track .stop.over { background: var(--red); cursor: default; }
.pct-track .stop.sel { width: 54px; height: 54px; top: 1px; background: var(--navy); font-weight: 700; font-size: 14px; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.pct-track .lbl { position: absolute; top: 64px; transform: translateX(-50%); color: var(--muted); font-size: 15px; }

.tasks-list { display: flex; flex-direction: column; gap: 10px; }
.task-row { display: flex; align-items: center; gap: 10px; }
.task-row .input { height: 42px; }

.assign-box { border: 1px solid var(--line); border-radius: var(--radius-md); max-height: 360px; overflow-y: auto; }
.assign-item { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.assign-item:last-child { border-bottom: 0; }
.assign-item:hover { background: #f7f7fa; }
.assign-item svg.veh { width: 54px; height: auto; flex: none; }
.assign-item .nm { font-weight: 700; }
.assign-item .sub { color: var(--muted); font-size: 13.5px; }

.summary-list { display: grid; grid-template-columns: 120px 1fr; gap: 14px 18px; font-size: 16px; color: var(--ink-2); }
.summary-list dt { color: var(--ink-2); font-weight: 600; }
.summary-list dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

.dropzone {
  border: 2px dashed var(--muted); border-radius: var(--radius-md);
  padding: 34px 24px; text-align: center; color: var(--ink-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  transition: background .15s ease, border-color .15s ease;
}
.dropzone b { color: var(--charcoal); }
.dropzone.drag { background: var(--navy-soft); border-color: var(--navy-500); }
.doc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.doc-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 14px; }
.doc-item a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.form-foot {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 18px 28px; margin-top: 0;
}
.audit { border-left: 4px solid var(--navy-500); padding-left: 18px; line-height: 1.9; font-weight: 700; min-width: 220px; }
.audit.tan { border-color: var(--tan); }
.audit span { font-weight: 400; color: var(--muted); margin-left: 8px; }
.form-foot .actions { margin-left: auto; display: flex; align-items: center; gap: 22px; }

/* ---------- Import ---------- */

.steps { display: flex; gap: 0; margin-bottom: 28px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 10px; padding: 0 22px 0 0; color: var(--faint); font-weight: 600; }
.step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid currentColor; font-weight: 700; font-size: 14px; }
.step.on { color: var(--charcoal); }
.step.on .n { background: var(--navy); color: #fff; border-color: var(--navy); }
.step.done { color: var(--navy-500); }
.step.done .n { background: var(--navy-soft); color: var(--navy); border-color: var(--navy-soft); }
.step + .step::before { content: ""; width: 34px; height: 1.5px; background: var(--line-strong); margin-right: 12px; }

.big-drop {
  display: block;
  border: 2px dashed var(--line-strong); border-radius: var(--radius-xl); background: var(--surface);
  padding: 70px 30px; text-align: center; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.big-drop:hover, .big-drop.drag { border-color: var(--navy-500); background: #f5f6fc; }
.big-drop h2 { font-size: 24px; margin: 18px 0 8px; }
.big-drop p { color: var(--muted); }
.big-drop .formats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.big-drop .formats span { padding: 4px 12px; border-radius: 12px; background: var(--bg); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.drop-art { display: flex; justify-content: center; gap: 4px; align-items: flex-end; color: var(--navy); }
.drop-art svg { height: 44px; width: auto; }

.map-table td { vertical-align: top; }
.map-table .samples { color: var(--muted); font-size: 13.5px; max-width: 340px; }
.map-table .samples span { display: inline-block; background: var(--bg); border-radius: 4px; padding: 1px 7px; margin: 2px 4px 2px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-table .select { height: 40px; width: 280px; font-size: 14.5px; }
.map-table td:last-child { white-space: nowrap; }
.conf { display: inline-block; width: 44px; height: 6px; border-radius: 3px; background: #e7e7ea; position: relative; overflow: hidden; vertical-align: middle; margin-left: 10px; }
.conf i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--navy-500); }
.map-table tr.unmapped td:first-child { color: var(--muted); }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 22px; min-width: 150px; }
.stat .v { font-size: 30px; font-weight: 400; }
.stat .k { color: var(--muted); font-size: 14px; }
.issues { max-height: 220px; overflow-y: auto; font-size: 14px; color: var(--ink-2); padding-left: 18px; margin: 10px 0 0; }

/* ---------- Dashboard ---------- */

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 26px; margin-top: 26px; }
.empty-fleet { display: flex; align-items: flex-end; width: 100%; max-width: 520px; margin: 0 auto 10px; }
.empty-fleet > span { min-width: 0; }
.empty .empty-fleet svg.veh { display: block; width: 100%; height: auto; margin: 0; }
.fleet-mix { display: flex; flex-direction: column; gap: 4px; }
.mix-row { display: grid; grid-template-columns: 84px 1fr 40px; gap: 14px; align-items: center; padding: 8px 0; text-decoration: none; }
.mix-row svg.veh { width: 76px; height: auto; }
.mix-row .bar { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.mix-row .bar i { display: block; height: 100%; background: var(--navy-500); border-radius: 5px; }
.mix-row .lbl { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.mix-row .n { font-weight: 700; text-align: right; }
.mix-row:hover .lbl { color: var(--navy-500); }
.attn { display: flex; flex-direction: column; }
.attn a { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; }
.attn a:first-child { border-top: 0; }
.attn .t, .attn .s { display: block; }
.attn .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn .s { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn a:hover .t { text-decoration: underline; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.kpi { background: var(--surface); border-radius: var(--radius-lg); padding: 20px 24px; }
.kpi .v { font-size: 32px; line-height: 1.1; margin-top: 6px; }
.kpi .k { color: var(--muted); font-weight: 600; font-size: 14px; }
.kpi .s { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title h2 { font-size: 20px; }

.empty { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty svg.veh { width: 180px; height: auto; margin: 0 auto 18px; opacity: .8; }
.empty h3 { color: var(--ink); font-size: 20px; margin-bottom: 8px; }
.empty .row { justify-content: center; margin-top: 20px; }

/* ---------- Overlays ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(40, 40, 40, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px 20px; overflow-y: auto;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 680px; background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-pop); animation: rise .2s ease-out;
}
.modal.wide { max-width: 1440px; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 18px; padding: 28px 36px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.modal-head h2 { font-size: 26px; font-weight: 700; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 28px 36px; }
.modal.wide .modal-body { background: var(--bg); border-radius: 0 0 var(--radius-xl) var(--radius-xl); max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 36px 28px; }

.popover {
  position: absolute; z-index: 60;
  background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  border: 1px solid var(--line);
  animation: pop-in .15s ease-out;
}
.menu { padding: 8px; min-width: 220px; }
.menu button, .menu a {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; background: none; border-radius: 4px; cursor: pointer; text-align: left; text-decoration: none; font-size: 15px;
}
.menu button:hover, .menu a:hover { background: var(--navy-soft); }
.menu .danger { color: var(--red); }
.menu .sel { background: var(--red); color: #fff; }
.sort-pop { padding: 0; min-width: 480px; }
.sort-pop .sort-row { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 14px; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.sort-pop .sort-row:last-child { border-bottom: 0; }
.sort-pop .sort-row b { font-weight: 700; }
.sort-pop .option { height: 46px; font-size: 15px; }

.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--navy); color: #fff; padding: 14px 20px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop); font-weight: 600; display: flex; align-items: center; gap: 12px; max-width: 420px;
  animation: rise .2s ease-out;
}
.toast .icon { color: #fff; }
.toast.err { background: #9e1520; }
.toast.err .icon { color: #ffd1cd; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--navy-500); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 80px; }
.skeleton { background: linear-gradient(90deg, #ececef 0%, #f6f6f8 50%, #ececef 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; border-radius: var(--radius-md); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Login ---------- */

.login {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr);
}
.login-art {
  background: var(--charcoal); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-art .brand { color: #fff; padding: 0; justify-content: flex-start; }
.login-art h1 { font-size: 40px; line-height: 1.15; font-weight: 700; max-width: 520px; }
.login-art p { color: #d6d5d5; font-size: 17px; margin-top: 16px; max-width: 480px; line-height: 1.6; }
.login-art .convoy { display: flex; align-items: flex-end; gap: 6px; opacity: .95; margin: 0 -64px -56px; padding: 0 64px 40px; border-bottom: 10px solid var(--red); }
.login-art .convoy svg { height: auto; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.login-form form { width: 100%; max-width: 400px; }
.login-form h2 { font-size: 28px; margin-bottom: 8px; }
.login-form .sub { color: var(--muted); margin-bottom: 30px; }
.login-mobile-brand { display: none; margin-bottom: 28px; }
.login-mobile-brand .lockup-tag { color: var(--navy); }
.form-error { background: var(--red-soft); color: #9c231c; padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; }

/* ---------- Responsive ---------- */

@media (max-width: 1360px) {
  :root { --rail-w: 300px; }
  .plan-group { padding: 30px 32px 20px; }
  .plan-line { grid-template-columns: 96px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 30px 40px auto; padding: 22px 28px; }
}
@media (max-width: 1180px) {
  .content { flex-direction: column; }
  .rail { width: auto; border-left: 0; border-top: 1px solid var(--line); min-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .rail-section { border-bottom: 0; border-right: 1px solid var(--line); }
  .dash-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interval-grid { grid-template-columns: 1fr; }
  .interval-grid .right { border-left: 0; border-top: 1px solid var(--line); }
  .panel-sand .tiles { margin-left: 0; }
  .history-top { grid-template-columns: 1fr !important; gap: 24px !important; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  .app.nav-open .sidebar { transform: none; }
  .app.collapsed { --sidebar-w: 256px; }
  .collapse-btn { display: none; }
  .topbar .menu-btn { display: inline-grid; }
  .top-link .lbl { display: none; }
  .top-link { padding: 6px 12px; }
  .asset-row { grid-template-columns: 80px minmax(0, 1fr) auto; }
  .asset-row .status-block { grid-column: 2 / -1; }
  .asset-row .expand-btn { display: none; }
  .asset-thumb, .asset-thumb img, .asset-thumb svg { width: 72px; }
  .detail-pop { grid-column: 1 / -1; justify-self: stretch; }
  .detail-pop::before { display: none; }
  .plan-line { grid-template-columns: 90px minmax(0, 1fr) auto; }
  .plan-line > .k-status, .plan-line > .k-due { grid-column: 2 / -1; }
  .plan-line > .exp, .plan-line > .pdf-btn { display: none; }
  .log-card { grid-template-columns: 1fr; }
  .log-total { text-align: left; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-mobile-brand { display: block; }
  .meter-table { grid-template-columns: minmax(120px, 1fr) repeat(3, minmax(90px, 1fr)); }
  .sort-pop { min-width: 0; width: calc(100vw - 32px); }
}
@media (max-width: 640px) {
  .page { padding: 22px 16px 60px; }
  .topbar { padding: 0 12px; }
  .crumbs .hide-sm { display: none; }
  .page-head h1 { font-size: 25px; }
  .card-pad, .form-card { padding: 22px 20px; }
  .plan-group { padding: 24px 18px 14px; }
  .panel-sand { padding: 24px 20px; }
  .tiles { gap: 14px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .list-card .list-head, .plan-line { padding-left: 18px; padding-right: 18px; }
  .log-card { padding: 22px 20px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 20px; padding-right: 20px; }
  .interval-grid .left, .interval-grid .right { padding: 26px 20px; }
  .meter-row .meter-cell:first-child { margin-left: -20px; padding-left: 20px; }
  .meter-row .meter-cell:last-child { margin-right: -20px; padding-right: 20px; }
  .meter-table { grid-template-columns: 1fr 1fr 1fr; }
  .meter-table .h:first-child, .meter-row .meter-cell:first-child { grid-column: 1 / -1; height: auto; padding-bottom: 6px; }
  .meter-row .meter-cell:first-child { margin-right: -20px; }
  .meter-row .meter-cell:not(:first-child) { border-top: 0; height: auto; padding-top: 6px; }
  .form-foot { padding: 14px 16px; }
  .form-foot .audit { display: none; }
  .form-foot .actions { width: 100%; justify-content: space-between; }
}
@container (max-width: 1080px) {
  .interval-grid { grid-template-columns: 1fr; }
  .interval-grid .right { border-left: 0; border-top: 1px solid var(--line); }
  .interval-grid .due-cells .meter-cell:empty { display: none; }
}
@media (max-width: 640px) {
  .panel-sand .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .panel-sand .tile { height: 112px; padding: 14px; }
  .tile-num { font-size: 32px; }
  .tile-top { font-size: 14px; }
  .tile-top .icon { display: none; }
  .meters { gap: 6px 20px; font-size: 15px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.filter-bar .type-filter { margin: 0; flex: 1 1 auto; }
.filter-bar .select { width: auto; min-width: 170px; }
table.data td.veh-cell { min-width: 200px; }
.detail-pop .chips { flex-wrap: nowrap; }
@media (max-width: 640px) { .detail-pop .chips { flex-wrap: wrap; } }

/* ---------- Phones and tablets ---------- */

.mobile-only { display: none !important; }
.sheet-btn, .sheet-backdrop, .sheet-head { display: none; }
.pct-track .stop::after { content: ""; position: absolute; inset: -9px; }
.asset-cards { display: flex; flex-direction: column; }
.asset-card {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none;
}
.asset-card:last-child { border-bottom: 0; }
.asset-card:active { background: var(--navy-soft); }
.asset-card .thumb svg, .asset-card .thumb img { width: 76px; height: auto; border-radius: 4px; }
.asset-card .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.asset-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-card .top b { color: var(--navy); font-size: 16px; }
.asset-card .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card .meta { color: var(--muted); font-size: 13.5px; }
.asset-card .meta .tag { margin-left: 6px; }

@media (max-width: 900px) {
  /* 16px text stops iOS zooming into fields on focus */
  .input, .select, textarea.input { font-size: 16px; }
  .select.sm, .input.sm { font-size: 16px; }

  /* Filter panels become a slide-up sheet */
  .rail.rail-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    max-height: 82vh; max-height: 82dvh; overflow-y: auto; overscroll-behavior: contain;
    border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
    transform: translateY(105%); transition: transform .25s ease; min-height: 0;
  }
  .rail.rail-sheet.open { transform: none; }
  .rail-sheet .rail-section { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .rail-sheet .sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1; background: var(--surface);
    padding: 14px 12px 10px 20px; border-bottom: 1px solid var(--line); font-size: 18px;
  }
  .rail-sheet .rail-title { font-size: 18px; margin-bottom: 14px; }
  .sheet-btn {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; right: 16px; bottom: 18px; z-index: 80;
    height: 48px; padding: 0 20px; border: 0; border-radius: 24px; cursor: pointer;
    background: var(--navy); color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(36, 43, 122, .35);
  }
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(20, 20, 20, .45); }
  .sheet-backdrop[hidden] { display: none; }
  body.sheet-open { overflow: hidden; }

  /* Asset page: summary first, compact */
  .rail.rail-summary { order: -1; border-top: 0; border-bottom: 1px solid var(--line); }
  .asset-photo { aspect-ratio: 16 / 7; }
  .asset-photo > svg { width: 56%; }
  .asset-bar { padding: 14px 16px; gap: 10px; }
  .asset-bar .select { flex: 1 1 100%; max-width: none; }
  .asset-bar .spacer { display: none; }
  .asset-bar .btn { flex: 1 1 auto; }
  .tabs { padding: 0; }
  .tabs a { flex: 1; text-align: center; padding: 16px 10px; }

  /* Plan lines on the asset page */
  .plan-line {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name pct" "status status" "due due" "log log";
    gap: 10px; padding: 20px 18px;
  }
  .plan-line > :nth-child(1) { grid-area: pct; }
  .plan-line > :nth-child(2) { grid-area: name; }
  .plan-line > .k-status { grid-area: status; }
  .plan-line > .k-due { grid-area: due; }
  .plan-line > .bell { display: none; }
  .plan-line > [data-log] { grid-area: log; width: 100%; height: 44px; }
  .plan-line .t { font-size: 19px; }
  .plan-line .detail-pop { grid-column: 1 / -1 !important; }

  .page-head .btn { height: 40px; padding: 0 14px; font-size: 12.5px; }
}

@media (max-width: 640px) {
  .mobile-only { display: revert !important; }
  .desktop-only { display: none !important; }
  .select.mobile-only { display: block !important; }
  .asset-cards.mobile-only { display: flex !important; }

  .page-head { gap: 12px; margin-bottom: 20px; }
  .page-head .spacer { display: none; }
  .page-head .search { flex: 1 1 100%; max-width: none; order: 3; }
  .page-head > .btn, .page-head > a.btn, .page-head > .btn-text { order: 4; }
  .section-head .search, .list-head .search { flex: 1 1 100%; max-width: none; }
  .list-card .list-head { gap: 12px; padding: 20px 18px; }

  .filter-bar { gap: 10px; }
  .filter-bar .type-filter { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .filter-bar .type-filter::-webkit-scrollbar { display: none; }
  .filter-bar .type-filter button { flex: none; }
  .filter-bar .select { flex: 1 1 calc(50% - 5px); min-width: 0; width: auto; }
  .pager { flex-wrap: wrap; justify-content: center; }

  .attn a { grid-template-columns: 26px minmax(0, 1fr); row-gap: 6px; }
  .attn a > .tag, .attn a > .num { grid-column: 2; justify-self: start; }
  .card-title { flex-wrap: wrap; }

  .steps { gap: 8px; margin-bottom: 20px; }
  .step { padding: 0; }
  .step + .step::before { width: 14px; margin-right: 8px; }
  .step:not(.on) .lbl { display: none; }
  .big-drop { padding: 40px 18px; }
  .big-drop h2 { font-size: 20px; }
  .drop-art span { flex: 0 1 30%; }
  .map-table thead { display: none; }
  .map-table tbody tr { display: grid; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .map-table td { border: 0; padding: 0; }
  .map-table .samples { max-width: none; }
  .map-table .select { width: 100%; }
  .map-table td:last-child { white-space: normal; display: flex; align-items: center; }
  .stat { flex: 1 1 calc(50% - 7px); min-width: 0; padding: 14px 16px; }
  .stat .v { font-size: 22px; }

  /* Service plan form */
  .interval-bar { display: flex; flex-direction: column; width: 100%; }
  .interval-bar > * + * { border-left: 0 !important; border-top: 1px solid var(--charcoal); }
  .interval-bar > button { justify-content: center; }
  .interval-bar .recurring { flex-direction: column; align-items: stretch; }
  .interval-bar .recurring > button { width: 100%; }
  .interval-bar .sub { justify-content: center; }
  .meter-table { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 8px; }
  .meter-table .h { font-size: 13px; padding: 16px 0 6px; }
  .meter-row .meter-cell:first-child { grid-column: 1 / -1; }
  .meter-row[data-meter="time"] .meter-cell .row { flex-direction: column; align-items: stretch; }
  .meter-row[data-meter="time"] .meter-cell .input, .meter-row[data-meter="time"] .meter-cell .select { width: 100% !important; }
  .unit-input .input { padding-right: 34px; padding-left: 10px; }
  .unit-input span { right: 8px; font-size: 13px; }
  .due-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .due-cells .meter-cell { height: auto; padding: 12px 0; }
  .due-cells .chip { font-size: 13px; padding: 0 10px; }
  .pct-track .lbl { font-size: 13px; }
  .task-row .input { min-width: 0; }
  .assign-item svg.veh { width: 44px; }
  .form-foot .actions .btn-lg { height: 48px; padding: 0 20px; }

  .log-card .kv { grid-template-columns: 110px 1fr; }
  .kv { grid-template-columns: 120px 1fr; }

  /* Modals fill the screen */
  .overlay { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; min-height: 100%; min-height: 100dvh; }
  .modal-head { padding: 18px 16px; gap: 12px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
  .modal-head h2 { font-size: 21px; }
  .modal-head .search { flex: 1 1 100%; order: 5; margin-left: 0 !important; }
  .modal-head .select { flex: 1 1 auto; width: auto !important; order: 6; }
  .modal.wide .modal-body { max-height: none; border-radius: 0; padding: 16px; }
  .modal-foot { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 14px 16px; }
  .modal-foot .btn { flex: 1; }
  .oem-grid { grid-template-columns: 1fr; gap: 16px; }
  .sort-pop { left: 16px !important; }
  .sort-pop .sort-row { grid-template-columns: 1fr 1fr; padding: 12px 16px; }
  .sort-pop .sort-row b { grid-column: 1 / -1; }
  .toasts { left: 16px; right: 16px; bottom: 80px; }
  .toast { max-width: none; }
}
#pct-info { position: relative; }
#pct-info::after { content: ""; position: absolute; inset: -9px; }

@media (max-width: 900px) {
  /* Asset page: summary above the content, filters below it */
  .rail.rail-summary { display: contents; }
  .rail-summary > .rail-section { background: var(--surface); }
  .rail-summary > .rail-section:first-child { order: -2; border-bottom: 1px solid var(--line); }
  .rail-summary > .rail-cost, .rail-summary > .status-strip { order: -1; }
  .rail-summary > #rail-filters { order: 1; border-top: 1px solid var(--line); }
  .asset-bar .btn { flex: 1 1 0; padding: 0 10px; letter-spacing: .04em; }
  .asset-bar .icon-btn { flex: none; }
}
@media (max-width: 640px) {
  .page-head > .btn, .page-head > a.btn { flex: 1 1 calc(50% - 6px); }
  .attn br { display: none; }
  .attn .s { margin-top: 2px; }
  .filter-bar .select { text-overflow: ellipsis; }

  /* Plan form meters: 6-column grid so dates get half a row each */
  .meter-table { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .meter-table .h { grid-column: span 2; }
  .meter-table .h:first-child, .meter-row .meter-cell:first-child { grid-column: 1 / -1; }
  .meter-row .meter-cell { grid-column: span 2; }
  .meter-row[data-meter="time"] .meter-cell:nth-child(2) { grid-column: 1 / -1; }
  .meter-row[data-meter="time"] .meter-cell:nth-child(3), .meter-row[data-meter="time"] .meter-cell:nth-child(4) { grid-column: span 3; }
  .meter-row[data-meter="time"] .meter-cell .row { flex-direction: row; }
  .meter-row[data-meter="time"] .meter-cell .input { width: 90px !important; flex: none; }
  .meter-row[data-meter="time"] .meter-cell .select { flex: 1; width: auto !important; }
  .meter-row[data-meter="time"] .meter-cell:nth-child(3) .input, .meter-row[data-meter="time"] .meter-cell:nth-child(4) .input { width: 100% !important; }
}

.nav-backdrop { display: none; }
@media (max-width: 900px) {
  .app.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(20, 20, 20, .45); }
  .app.nav-open { overflow: hidden; }
}

@media (max-width: 640px) {
  .page .row:has(> .btn-lg) { flex-wrap: wrap; }
  .page .row:has(> .btn-lg) > .btn { flex: 1 1 100%; }
  .page .row:has(> .btn-lg) > .btn-primary { order: -1; }
  .step + .step::before { display: none; }
  .steps { gap: 10px; }
  .list-head h2 { font-size: 19px; }
}
@media (max-width: 640px) { table.data td.strong { white-space: nowrap; } }
