/* ===========================================================
   TMPS — Tire & Weight Management System
   Shared stylesheet
   =========================================================== */

:root {
  --bg: #021425;
  --bg-elevated: #031b30;
  --bg-card: #04213a;
  --bg-input: #021b31;
  --bg-hover: #07304f;

  --border: #0d3557;
  --border-soft: #08284a;

  --accent: #1273e6;
  --accent-dim: #0a4a94;
  --accent-soft: rgba(18, 115, 230, 0.14);

  --text: #eaf1fb;
  --text-dim: #8fb0d6;
  --text-faint: #5c7fa6;

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --yellow: #eab308;
  --yellow-soft: rgba(234, 179, 8, 0.12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --gray: #64748b;
  --gray-soft: rgba(100, 116, 139, 0.12);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --sidebar-w: 240px;
  --shadow: 0 10px 28px rgba(0, 6, 16, 0.55);
  --card-glow: inset 0 1px 0 rgba(110, 180, 255, 0.07), 0 8px 22px rgba(0, 6, 16, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Arial, sans-serif;
  font-size: 14px;
  min-width: 1280px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

svg { display: block; }

.app {
  display: flex;
  min-height: 100vh;
}

/* ---------------- Sidebar ---------------- */

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #021a2f 0%, #031b31 60%, #03182b 100%);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 380px;
  background: url("../assets/design/sidebar-truck.png") center bottom / 100% auto no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
  pointer-events: none;
  z-index: 0;
}
.sidebar > * { position: relative; z-index: 1; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px 8px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 18px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.brand-mark svg { width: 22px; height: 22px; }

.brand-text .brand-name {
  font-size: 19px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.5px;
  color: #4f9cf9;
  line-height: 1;
}

.brand-text .brand-sub {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-faint);
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.3;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.nav-link svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-link.active {
  background: linear-gradient(90deg, var(--accent-dim), rgba(47,123,240,0.18));
  color: #fff;
  font-weight: 600;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.sidebar-footer {
  margin-top: 16px;
  padding: 14px 12px;
  background: none;
  border: none;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.sidebar-footer svg { width: 26px; height: 26px; flex: none; color: var(--accent); }
.sidebar-footer p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
  font-weight: 600;
}

/* ---------------- Main / Topbar ---------------- */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .crumb {
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.topbar .crumb .current { color: var(--text); font-weight: 600; }

.page-title { display: flex; flex-direction: column; gap: 3px; }
.page-title h1 { margin: 0; font-size: 21px; font-weight: 700; }
.page-title p { margin: 0; font-size: 12.5px; color: var(--text-dim); }

.topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-faint);
}
.topbar-search svg { width: 16px; height: 16px; flex: none; }
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  width: 100%;
}
.topbar-search input::placeholder { color: var(--text-faint); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.icon-btn svg { width: 17px; height: 17px; }

/* dropdowns under the top bar (alerts bell, account menu) */
.pop-wrap { position: relative; }
.pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.pop[hidden] { display: none; }
.pop.pop-small { width: 160px; }
.pop-head { padding: 10px 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.pop-item {
  display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0;
  color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none;
}
.pop-item:hover { background: var(--bg-hover); }
.pop-alert { border-bottom: 1px solid var(--border); }
.pop-alert:last-child { border-bottom: 0; }
.pop-alert b { display: block; font-size: 13px; }
.pop-alert span { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.pop-alert.red b { color: var(--red); }
.pop-alert.yellow b { color: var(--yellow); }
.pop-empty { padding: 18px 14px; font-size: 13px; color: var(--text-dim); text-align: center; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.icon-btn .dot {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.meta-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.meta-pill svg { width: 14px; height: 14px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  cursor: pointer;
}
.user-info { min-width: 80px; }
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  color: #fff;
}
.user-info .u-name { font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.user-info .u-role { font-size: 11px; color: var(--text-faint); line-height: 1.2; white-space: nowrap; }

.content {
  padding: 22px 26px 40px;
  flex: 1;
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s, background 0.15s;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-outline { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-outline:hover { color: var(--text); border-color: var(--accent); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------------- Cards / Panels ---------------- */

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 14px 0;
}
.panel-title svg { width: 17px; height: 17px; color: var(--accent); }

.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------------- Stat cards ---------------- */

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.warn { background: var(--red-soft); color: var(--red); }
.stat-pic { width: 92px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; }
.pic-card { flex-direction: column; align-items: stretch; gap: 10px; }
.pic-card .stat-pic { width: 100%; height: 84px; }
.pic-card .stat-body { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 12px; }
.pic-card .stat-body .stat-label { grid-column: 1; }
.pic-card .stat-body .stat-value { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: 30px; }
.pic-card .stat-body .stat-breakdown { grid-column: 1; }
.stat-pic img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.stat-body .stat-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.stat-body .stat-value { font-size: 24px; font-weight: 800; margin: 3px 0 6px; }
.stat-breakdown { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--text-faint); font-weight: 600; }
.stat-breakdown .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; }

/* ---------------- Badges / status ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge .bd { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: var(--gray-soft); color: var(--gray); }

.badge-green .bd { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.badge-yellow .bd { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); }
.badge-red .bd { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.badge-gray .bd { background: var(--gray); box-shadow: 0 0 0 3px var(--gray-soft); }

.pill-box {
  border: 1.5px solid var(--green);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  background: rgba(34,197,94,0.06);
  min-width: 74px;
}
.pill-box .p-sub { font-size: 10.5px; color: var(--text-dim); font-weight: 600; margin-top: 1px; }
.pill-box.pb-yellow { border-color: var(--yellow); background: rgba(234,179,8,0.07); }
.pill-box.pb-red { border-color: var(--red); background: rgba(239,68,68,0.07); }

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

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.data-table thead th {
  text-align: left;
  color: var(--text-faint);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}
.data-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ---------------- Forms ---------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.field input, .field select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* ---------------- Real design illustrations ---------------- */

.hero-shot {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}
.hero-shot-wrap {
  overflow-x: auto;
}
.u-icon-img {
  width: 52px;
  height: 30px;
  object-fit: contain;
  flex: none;
}

.row-vehicle {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.row-vehicle img { display:block; height: 26px; width: auto; }
.row-vehicle .dot-mark {
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  top: 74%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--bg-card);
}
.veh-cell { display:flex; align-items:center; gap:14px; }

.rig-img { width: 150px; height: auto; display: block; border-radius: 6px; }

.truck-photo {
  position: relative;
  width: 124px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #0a1626;
}
.truck-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.truck-photo .tp-dot {
  position: absolute; top: 5px; right: 5px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.select-card .sc-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ---------------- Truck diagram (top view) ---------------- */

.truck-lane {
  display: flex;
  align-items: center;
  position: relative;
  padding: 46px 10px;
  overflow-x: auto;
}

.axle-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.axle-head {
  text-align: center;
  margin-bottom: 4px;
}
.axle-head .a-name { font-size: 13px; font-weight: 800; letter-spacing: 0.3px; }
.axle-head .a-sub { font-size: 10.5px; color: var(--text-dim); font-weight: 600; margin-top: 1px; }

.tire-box {
  border: 1.5px solid var(--green);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  background: rgba(34,197,94,0.06);
  min-width: 62px;
}
.tire-box .t-temp { color: var(--text-dim); font-weight: 600; font-size: 10.5px; }
.tire-box.tb-yellow { border-color: var(--yellow); background: rgba(234,179,8,0.08); }
.tire-box.tb-red { border-color: var(--red); background: rgba(239,68,68,0.08); }

.wheel-pair { display: flex; gap: 4px; }
.wheel {
  width: 30px; height: 46px;
  border-radius: 6px;
  background: repeating-linear-gradient(180deg,#1a1a1a 0 4px,#050505 4px 8px);
  border: 2px solid #000;
  position: relative;
}
.wheel::after {
  content:"";
  position:absolute; inset: 30% 15%;
  background:#3a3a3a; border-radius:2px;
}
.wheel.w-dot { background: #1c1c1c; }
.wheel.status-green::before,
.wheel.status-yellow::before,
.wheel.status-red::before {
  content:"";
  position:absolute; left:50%; top:-9px; transform:translateX(-50%);
  width:9px; height:9px; border-radius:50%;
}
.wheel.status-green::before { background: var(--green); box-shadow:0 0 6px var(--green); }
.wheel.status-yellow::before { background: var(--yellow); box-shadow:0 0 6px var(--yellow); }
.wheel.status-red::before { background: var(--red); box-shadow:0 0 6px var(--red); }

.chassis-line {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 4px;
  background: linear-gradient(90deg, #d1d5db, #9ca3af);
  transform: translateY(-50%);
  z-index: 1;
  border-radius: 2px;
}

.cab-shape {
  width: 150px;
  height: 96px;
  border-radius: 14px 6px 6px 14px;
  background: linear-gradient(135deg,#dc2626,#7f1d1d);
  border: 2px solid #450a0a;
  position: relative;
  z-index: 2;
  flex: none;
  margin-right: -6px;
}
.cab-shape::before {
  content:"";
  position:absolute; left:14px; top:14px; width:44px; height:34px;
  background:#0a1522; border-radius:4px; border:2px solid #1e293b;
}
.cab-shape::after {
  content:"";
  position:absolute; left:64px; top:20px; right:10px; height:22px;
  background:#111c2f; border-radius:3px;
}

.trailer-shape {
  height: 76px;
  flex: 1;
  min-width: 240px;
  background: repeating-linear-gradient(90deg,#e5e7eb 0 34px,#d1d5db 34px 36px);
  border: 2px solid #9ca3af;
  border-radius: 4px;
  position: relative;
  z-index: 2;
}
.trailer-shape::before {
  content:"";
  position:absolute; left:0; top:0; bottom:0; width:6px;
  background: repeating-linear-gradient(180deg,#dc2626 0 10px,#f8fafc 10px 20px);
}

/* ---------------- Side-view axle diagram (weights page) ---------------- */

.side-truck {
  position: relative;
  height: 190px;
  margin: 20px 0 40px;
}
.side-truck .axle-marker {
  position: absolute;
  top: -34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translateX(-50%);
}
.side-truck .axle-marker .num {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items:center; justify-content:center;
  font-weight: 800; font-size: 12px; color:#fff;
  border: 2px solid var(--bg);
}
.side-truck .axle-marker .lbl { font-size: 11px; font-weight: 700; color: var(--text-dim); white-space:nowrap; }
.side-truck .connector {
  position: absolute;
  top: -6px;
  width: 2px;
  transform: translateX(-50%);
}
.side-truck .wheel-dot {
  position: absolute;
  bottom: 18px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid #050505;
  transform: translateX(-50%);
}

.side-cab {
  position: absolute;
  left: 0; bottom: 0;
  width: 210px; height: 130px;
  background: linear-gradient(160deg,#dc2626,#5b0f0f);
  border-radius: 22px 8px 0 0;
  border: 2px solid #3a0a0a;
}
.side-cab::before {
  content:"";
  position:absolute; left: 24px; top: 18px; width: 74px; height: 56px;
  background:#0a1522; border-radius: 8px 4px 0 0; border:2px solid #1e293b;
}
.side-trailer {
  position: absolute;
  bottom: 6px;
  height: 96px;
  background: linear-gradient(180deg,#e5e7eb,#cbd5e1);
  border: 2px solid #94a3b8;
  border-radius: 3px;
}
.side-trailer::before {
  content:"";
  position:absolute; left:0; top:0; bottom:0; width:8px;
  background: repeating-linear-gradient(180deg,#dc2626 0 8px,#f8fafc 8px 16px);
}
.side-chassis {
  position:absolute; bottom: 18px; left: 0; right:0; height: 5px;
  background:#475569; z-index:0;
}

/* ---------------- Donut chart ---------------- */

.donut-wrap { display:flex; align-items:center; gap: 18px; }
.donut {
  width: 96px; height: 96px;
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  position: relative;
  flex: none;
}
.donut .donut-inner {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--bg-card);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.donut .donut-inner b { font-size: 20px; line-height:1; }
.donut .donut-inner span { font-size: 10px; color: var(--text-dim); font-weight:600; }

.legend-list { display:flex; flex-direction:column; gap:7px; font-size:12.5px; font-weight:600; }
.legend-list .lg-row { display:flex; align-items:center; gap:8px; }
.legend-list .lg-dot { width:9px; height:9px; border-radius:50%; }
.legend-list .lg-label { min-width: 96px; color: var(--text-dim); }
.legend-list .lg-val { margin-left:auto; font-weight:800; }

/* ---------------- Alert banner ---------------- */

.banner {
  display:flex; align-items:flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--green);
  background: rgba(34,197,94,0.08);
}
.banner.b-red { border-color: var(--red); background: rgba(239,68,68,0.08); }
.banner.b-blue { border-color: var(--accent); background: var(--accent-soft); }
.banner svg { width:20px; height:20px; color: var(--green); flex:none; margin-top:1px; }
.banner.b-red svg { color: var(--red); }
.banner.b-blue svg { color: var(--accent); }
.banner .b-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.banner .b-desc { font-size: 12px; color: var(--text-dim); }

/* ---------------- Tabs ---------------- */

.tabs { display:flex; gap:4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 18px; }
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: var(--accent); border-color: var(--accent); }
.tab:hover:not(.active) { color: var(--text); }

.seg-tabs { display:flex; background: var(--bg-input); border:1px solid var(--border); border-radius: var(--radius-sm); padding:3px; }
.seg-tab { padding: 8px 16px; font-size:12.5px; font-weight:700; color:var(--text-dim); border-radius:6px; cursor:pointer; }
.seg-tab.active { background: var(--accent); color:#fff; }

/* ---------------- Selection cards (vehicle setup) ---------------- */

.select-card {
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.select-card:hover { border-color: var(--accent-dim); }
.select-card.selected { border-color: var(--accent); background: rgba(47,123,240,0.08); }
.select-card .sc-check {
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
}
.select-card.selected .sc-check {
  background: var(--accent); border-color: var(--accent);
  display:flex; align-items:center; justify-content:center;
}
.select-card.selected .sc-check svg { width:12px; height:12px; color:#fff; }
.select-card .sc-icon { height: 84px; display:flex; align-items:center; justify-content:center; margin-bottom:10px; }
.select-card .sc-icon svg { width: 90%; height: 100%; }
.select-card .sc-name { font-weight:700; font-size:13px; text-align:center; }
.select-card .sc-desc { font-size:11px; color:var(--text-dim); text-align:center; margin-top:2px; }

.step-head { display:flex; align-items:center; gap:12px; margin-bottom: 16px; }
.step-num {
  width: 30px; height:30px; border-radius:50%;
  background: var(--accent); color:#fff; font-weight:800; font-size:13px;
  display:flex; align-items:center; justify-content:center; flex:none;
}
.step-head h2 { margin:0; font-size:16px; }
.step-head p { margin: 2px 0 0; font-size:12px; color:var(--text-dim); }

hr.sep { border:none; border-top:1px solid var(--border-soft); margin: 18px 0; }

.summary-row { display:flex; justify-content:space-between; padding:8px 0; font-size:13px; border-bottom:1px solid var(--border-soft); }
.summary-row:last-child { border-bottom:none; }
.summary-row .s-label { color: var(--text-dim); font-weight:600; }
.summary-row .s-val { font-weight:700; }

.map-placeholder {
  position: relative;
  height: 100%;
  min-height: 320px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 30%, rgba(34,197,94,0.06), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(47,123,240,0.08), transparent 45%),
    linear-gradient(180deg,#0d1c33,#0a1626);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.map-placeholder .grid-lines {
  position:absolute; inset:0;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 40px 40px;
}
.map-marker {
  position:absolute;
  width: 16px; height:16px; border-radius:50%;
  border: 3px solid var(--bg);
  transform: translate(-50%,-50%);
  cursor: pointer;
}
.map-marker::after {
  content:""; position:absolute; inset:-6px; border-radius:50%;
  border: 1px solid currentColor; opacity:0.4;
}
.map-toggle { position:absolute; top:14px; right:14px; display:flex; background:var(--bg-card); border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.map-toggle span { padding:6px 12px; font-size:11.5px; font-weight:700; color:var(--text-dim); cursor:pointer; }
.map-toggle span.active { background:var(--accent); color:#fff; }

.list-scroll { max-height: 620px; overflow-y: auto; }
.list-scroll::-webkit-scrollbar { width: 6px; }
.list-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius:3px; }

.unit-row {
  display:flex; align-items:center; gap:12px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  cursor:pointer;
  border: 1px solid transparent;
}
.unit-row:hover { background: var(--bg-hover); }
.unit-row.active { background: rgba(47,123,240,0.1); border-color: var(--accent-dim); }
.unit-row .u-icon {
  width: 56px; height:36px; border-radius:8px;
  background: var(--bg-elevated);
  display:flex; align-items:center; justify-content:center;
  flex:none;
  color: var(--accent);
  overflow: hidden;
}
.unit-row .u-icon svg { width:20px; height:20px; }
.unit-row .u-mid { flex:1; min-width:0; }
.unit-row .u-title { font-weight:700; font-size:13px; display:flex; align-items:center; gap:8px; }
.unit-row .u-sub { font-size:11.5px; color:var(--text-dim); margin-top:2px; }
.unit-row .u-loc { font-size:11.5px; color:var(--text-dim); text-align:right; }

.qa-grid { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.qa-btn {
  display:flex; align-items:center; gap:9px;
  padding:11px 12px;
  background: var(--bg-elevated);
  border:1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:12.5px; font-weight:700;
  cursor:pointer;
}
.qa-btn svg { width:16px; height:16px; color:var(--accent); }
.qa-btn:hover { background: var(--bg-hover); }

.pagination { display:flex; align-items:center; justify-content:center; gap:6px; margin-top:16px; }
.pagination button {
  width:30px; height:30px; border-radius:6px;
  border:1px solid var(--border); background: var(--bg-card); color: var(--text-dim);
  cursor:pointer; font-size:12.5px; font-weight:700;
}
.pagination button.active { background: var(--accent); color:#fff; border-color:var(--accent); }
.pagination button:hover:not(.active) { color: var(--text); }

.progress-bar { height:8px; border-radius:4px; background: var(--bg-input); overflow:hidden; }
.progress-bar > div { height:100%; background: linear-gradient(90deg,#22c55e,#16a34a); }

.mini-note {
  font-size:11.5px; color:var(--text-dim); line-height:1.5;
  background: var(--bg-elevated); border:1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding:10px 12px; margin-top:12px;
}

.flex-between { display:flex; align-items:center; justify-content:space-between; }
.mt-8 { margin-top:8px; } .mt-12 { margin-top:12px; } .mt-16 { margin-top:16px; } .mt-20{margin-top:20px;}
.text-dim { color: var(--text-dim); }
.text-green { color: var(--green); } .text-yellow{color:var(--yellow);} .text-red{color:var(--red);}

/* ---------------- 3D-look polish (matches the rendered design) ---------------- */

body {
  background:
    radial-gradient(900px 420px at 72% -80px, rgba(10, 80, 150, 0.30), transparent 70%),
    radial-gradient(700px 520px at 0% 100%, rgba(0, 60, 110, 0.22), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.panel, .stat-card, .m-truck-card, .w-card {
  background:
    linear-gradient(180deg, rgba(14, 70, 120, 0.20), rgba(4, 33, 58, 0) 48%),
    var(--bg-card);
  box-shadow: var(--card-glow);
}
.topbar { background: rgba(2, 20, 37, 0.82); backdrop-filter: blur(8px); }
.btn-primary {
  background: linear-gradient(180deg, #1f8af7 0%, #0a5fc8 100%);
  box-shadow: 0 4px 14px rgba(18, 115, 230, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.nav-link.active {
  background: linear-gradient(90deg, #0a4a94 0%, rgba(10, 74, 148, 0.25) 100%);
  box-shadow: inset 0 1px 0 rgba(120, 190, 255, 0.10);
}
.brand-mark { box-shadow: 0 4px 16px rgba(18, 115, 230, 0.45); }

/* ---------------- World-map background for the fleet table ---------------- */
.map-panel { position: relative; overflow: hidden; }
.map-panel::before {
  content: "";
  position: absolute; inset: 0;
  background: url("../assets/design/world-map.svg") center 40% / 118% auto no-repeat;
  opacity: 0.5;
  filter: drop-shadow(0 0 2px rgba(70, 175, 255, 0.95)) drop-shadow(0 0 7px rgba(35, 135, 255, 0.65));
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 95%);
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 95%);
  pointer-events: none;
}
.map-panel > * { position: relative; }

.map-panel td, .map-panel th { text-shadow: 0 0 8px rgba(2, 20, 37, 0.95), 0 1px 2px rgba(2, 20, 37, 0.8); }
.map-panel .data-table thead th,
.map-panel .data-table tbody td { border-bottom: none; }
/* column titles above the truck rows: neon white so they read over the map */
.map-panel .data-table thead th {
  color: #ffffff;
  font-size: 11px;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.95), 0 0 9px rgba(190, 225, 255, 0.85), 0 0 18px rgba(70, 165, 255, 0.65);
}

/* ---------------- Glowing outlines on every page ---------------- */
.panel, .stat-card, .m-truck-card, .w-card, .select-card, .pair-progress, .slot-row {
  border-color: rgba(40, 140, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(40, 140, 255, 0.10),
    0 0 16px rgba(30, 130, 255, 0.22),
    inset 0 1px 0 rgba(110, 180, 255, 0.10),
    0 8px 22px rgba(0, 6, 16, 0.45);
}
.select-card.selected, .slot-row.paired { box-shadow: 0 0 0 1px rgba(40, 140, 255, 0.35), 0 0 22px rgba(30, 130, 255, 0.40); }
.w-card.over { border-color: var(--red); box-shadow: 0 0 16px rgba(239, 68, 68, 0.30); }
.sidebar { border-right-color: rgba(40, 140, 255, 0.50); box-shadow: 4px 0 22px rgba(30, 130, 255, 0.14); }
.topbar { border-bottom-color: rgba(40, 140, 255, 0.45); box-shadow: 0 4px 20px rgba(30, 130, 255, 0.10); }
.tab-bar { border-top-color: rgba(40, 140, 255, 0.45); box-shadow: 0 -4px 20px rgba(30, 130, 255, 0.12); }

/* ---------------- Fleet table: glass "magnifier" row on hover ---------------- */
.map-panel .data-table tbody tr { transition: transform 0.18s ease; }
.map-panel .data-table tbody tr:hover {
  background: transparent;
  transform: scale(1.02);
  position: relative;
  z-index: 3;
}
.map-panel .data-table tbody tr:hover td {
  background: linear-gradient(180deg, rgba(130, 195, 255, 0.20), rgba(50, 130, 240, 0.07));
  box-shadow: inset 0 1px 0 rgba(160, 215, 255, 0.50), inset 0 -1px 0 rgba(160, 215, 255, 0.28);
}
.map-panel .data-table tbody tr:hover td:first-child {
  border-radius: 12px 0 0 12px;
  box-shadow: inset 0 1px 0 rgba(160, 215, 255, 0.50), inset 0 -1px 0 rgba(160, 215, 255, 0.28), inset 1px 0 0 rgba(160, 215, 255, 0.40);
}
.map-panel .data-table tbody tr:hover td:last-child {
  border-radius: 0 12px 12px 0;
  box-shadow: inset 0 1px 0 rgba(160, 215, 255, 0.50), inset 0 -1px 0 rgba(160, 215, 255, 0.28), inset -1px 0 0 rgba(160, 215, 255, 0.40);
}

.map-panel .data-table tbody tr[data-unit] { cursor: pointer; }

/* ---------------- Compact top block on Fleet Overview ---------------- */
#dash .stat-card { padding: 12px 14px; gap: 10px; }
#dash .stat-value { font-size: 22px; margin: 2px 0 4px; }
#dash .stat-icon { width: 36px; height: 36px; }
#dash .stat-breakdown { font-size: 10.5px; }
#dash .panel { padding: 12px 16px; }
#dash .panel-title { margin-bottom: 8px; font-size: 13.5px; }
#dash .donut { width: 64px; height: 64px; }
#dash .donut .donut-inner { width: 46px; height: 46px; }
#dash .donut .donut-inner b { font-size: 16px; }
#dash .legend-list { gap: 4px; font-size: 12px; }
#dash .legend-list .lg-label { min-width: 74px; }

.dual-alert { border-color: rgba(239, 68, 68, 0.55) !important; background: linear-gradient(90deg, rgba(239, 68, 68, 0.16), rgba(234, 179, 8, 0.10)), var(--bg-card) !important; align-items: stretch; justify-content: center; }
.dual-alert .da-part { flex: 0 1 auto; display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: inherit; min-width: 0; }
.dual-alert .da-sep { width: 1px; background: rgba(255, 255, 255, 0.14); margin: 2px 18px; flex: none; }
.dual-alert .stat-label, .dual-alert .stat-breakdown div { white-space: nowrap; }

.alert-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.alert-pair .stat-card { min-width: 0; }
.alert-pair .stat-label, .alert-pair .stat-breakdown div { white-space: normal; }


/* ---------------- Movable / resizable dashboard blocks ---------------- */
.dash-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.dash-toolbar .btn { padding: 6px 12px; font-size: 12px; }
.dash-grid { display: grid; grid-template-columns: repeat(48, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
/* Below the width the locked row was designed/tested at (~1920px screen), scroll the row sideways
   instead of squeezing cards until their text and numbers overflow, e.g. on a 14" MacBook.
   Scoped to this max-width only - do not remove the media query, it changes how 1fr columns are
   sized and widens the row even on desktop if applied unconditionally. */
@media (max-width: 1700px) {
  .dash-grid { grid-template-columns: repeat(48, minmax(32px, 1fr)); overflow-x: auto; padding-bottom: 2px; }
}
.dash-grid > * { min-width: 0; position: relative; }
.dash-handle { position: absolute; right: 5px; bottom: 5px; width: 16px; height: 16px; cursor: nwse-resize; display: none; z-index: 6; border-right: 3px solid #4db2ff; border-bottom: 3px solid #4db2ff; border-radius: 0 0 7px 0; filter: drop-shadow(0 0 4px rgba(70, 175, 255, 0.9)); }
.dash-editing .dash-handle { display: block; }
.dash-editing .dash-grid > * { outline: 1.5px dashed rgba(90, 180, 255, 0.75); outline-offset: 3px; cursor: grab; user-select: none; -webkit-user-select: none; }
.dash-editing .dash-grid a { pointer-events: none; }
.dash-editing .dash-grid img { pointer-events: none; }
.dash-grid > .dash-dragging { opacity: 0.4; }
.dash-editing #dashEditBtn { background: linear-gradient(180deg, #1f8af7, #0a5fc8); color: #fff; border-color: transparent; }
.dash-editing .dash-grid a .dash-handle { pointer-events: auto; }

/* ---------------- Unit detail page (design #723) ---------------- */
.ut-trailer { display: flex; align-items: center; gap: 12px; margin-left: 28px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(4, 33, 58, 0.6); }
.ut-trailer-icon { width: 64px; height: 34px; display: flex; align-items: center; justify-content: center; }
.ut-trailer-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ut-status { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 12px; border: 1.5px solid var(--green); background: rgba(34, 197, 94, 0.10); }
.ut-status.bad { border-color: var(--red); background: rgba(239, 68, 68, 0.12); }
.ut-status-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.ut-status.bad .ut-status-icon { background: var(--red); }
.ut-status-icon svg { width: 22px; height: 22px; }
.tabs .tab { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.ut-panel { padding: 16px 20px; margin-bottom: 16px; }
.ut-title { font-size: 24px; font-weight: 800; letter-spacing: 0.3px; }
.ut-chip { display: inline-flex; align-items: center; gap: 7px; }
.ut-badge-over { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 1.5px solid var(--red); border-radius: 8px; background: rgba(239, 68, 68, 0.14); color: #ff6b6b; font-weight: 800; font-size: 17px; letter-spacing: 0.4px; }
.ut-badge-ok { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 1.5px solid var(--green); border-radius: 8px; background: rgba(34, 197, 94, 0.14); color: var(--green); font-weight: 800; font-size: 17px; }
.ut-wrow { display: grid; grid-template-columns: repeat(5, 1fr) 1.25fr; gap: 12px; margin-top: 10px; }
.ut-wcard { border: 1.5px solid; border-radius: 10px; padding: 10px 10px 10px; text-align: center; }
.ut-wcard.over { border-color: var(--red); background: linear-gradient(180deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.03)); }
.ut-wcard.ok { border-color: var(--green); background: linear-gradient(180deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.03)); }
.ut-wname { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 11.5px; font-weight: 700; margin-bottom: 8px; }
.ut-num { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; border: 2px solid; flex: none; }
.ut-num.over { border-color: var(--red); color: var(--red); }
.ut-num.ok { border-color: var(--green); color: var(--green); }
.ut-wval { font-size: 21px; font-weight: 800; }
.ut-wlim { font-size: 12.5px; margin-top: 4px; }
.ut-wlim2 { font-size: 12.5px; }
.ut-wdiff { font-size: 13px; font-weight: 800; margin: 2px 0 6px; }
.ut-wdiff.over { color: #ff5b5b; }
.ut-wdiff.ok { color: var(--green); }
.ut-wbadge { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 4px; border-radius: 6px; font-size: 12px; font-weight: 800; }
.ut-wbadge.over { background: rgba(239, 68, 68, 0.22); color: #ff8080; border: 1px solid rgba(239, 68, 68, 0.6); }
.ut-wbadge.ok { background: rgba(34, 197, 94, 0.22); color: #4ade80; }
.ut-gross { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: rgba(2, 27, 49, 0.6); }
.ut-gross-title { font-size: 12px; color: var(--text-dim); font-weight: 700; }
.ut-gross-val { font-size: 27px; font-weight: 800; margin: 4px 0 8px; }
.ut-gross-line { display: flex; justify-content: space-between; font-size: 13px; margin: 3px 0; }
.ut-gross-line b { font-size: 14px; }
.ut-row2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-bottom: 16px; }
.ut-adjust { border: 1.5px solid var(--red); border-radius: 12px; padding: 14px 18px; background: linear-gradient(180deg, rgba(239, 68, 68, 0.10), rgba(239, 68, 68, 0.03)); }
.ut-adjust.ok { border-color: var(--green); background: linear-gradient(180deg, rgba(34, 197, 94, 0.10), rgba(34, 197, 94, 0.03)); }
.ut-adjust-head { display: flex; align-items: center; gap: 12px; color: var(--red); }
.ut-adjust.ok .ut-adjust-head { color: var(--green); }
.ut-adjust-title { font-size: 17px; font-weight: 800; color: var(--red); }
.ut-adjust-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; margin-top: 10px; }
.ut-opt { display: flex; align-items: center; gap: 10px; }
.ut-opt-img { width: 88px; height: auto; mix-blend-mode: lighten; flex: none; }
.ut-arrow { color: var(--red); display: inline-flex; flex: none; }
.ut-opt-title { color: var(--red); font-weight: 800; font-size: 14px; line-height: 1.25; }
.ut-opt-text { font-size: 11.5px; line-height: 1.4; margin-top: 4px; }
.ut-or { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 64px; justify-content: center; border-left: 1px solid rgba(255,255,255,0.16); border-right: 0; padding: 0 12px; font-size: 12px; font-weight: 700; }
.ut-guide { border: 1px solid rgba(40, 140, 255, 0.5); border-radius: 12px; padding: 14px 18px; background: rgba(4, 33, 58, 0.7); }
.ut-guide-title { color: #4db2ff; font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.ut-guide-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin: 8px 0; }
.ut-guide-num { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #4db2ff; color: #4db2ff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.ut-row3 { display: grid; grid-template-columns: 2.3fr 1fr; gap: 16px; }
.ut-topview { width: 100%; display: block; }
.ut-side { display: flex; flex-direction: column; gap: 14px; }
.ut-tgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.ut-tcol { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ut-tcol-h { text-align: center; margin-bottom: 4px; }
.ut-tcol-h b { display: block; font-size: 13px; }
.ut-tcol-h span { font-size: 10.5px; color: var(--text-dim); }

/* axle markers over the truck render */
.ut-hero { padding: 10px 0 170px; max-width: 980px; margin: 0 auto; }
.ut-imgbox { position: relative; }
.ut-imgbox > img { width: 100%; display: block; }
.ut-mk { position: absolute; top: -90px; height: calc(92% + 90px); width: 0; display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); --c: var(--green); pointer-events: none; }
.ut-mk.red { --c: var(--red); } .ut-mk.yellow { --c: var(--yellow); }
.ut-mk-num { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--c); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; background: rgba(2, 20, 37, 0.75); flex: none; box-shadow: 0 0 10px var(--c); }
.ut-mk-lbl { margin-top: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.3px; white-space: nowrap; flex: none; }
.ut-mk-line { flex: 1; width: 2px; background: var(--c); margin-top: 4px; box-shadow: 0 0 6px var(--c); }
.ut-mk-dot { position: absolute; bottom: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 8px var(--c); }
.ut-mk.low { padding-top: 0; }
.ut-mk.low .ut-mk-lbl { margin-top: 6px; }
.ut-hero { max-width: none; padding-left: 16px; padding-right: 16px; }
.ut-hero .rig-compose { width: 85% !important; margin: 0 auto; }
.ut-hero .ut-imgbox { width: 85%; margin: 0 auto; }
.ut-mk { height: calc(86.8% + 90px); }
.ut-mk-dot { bottom: -7px; }

/* ---------------- Composed truck + trailer (Vehicle Setup / custom units) ---------------- */
.rig-compose { display: flex; align-items: flex-end; }
.rig-compose img { display: block; height: auto; flex: none; }
.rig-compose .rc-trailer { position: relative; z-index: 0; }
.rig-compose .rc-truck { position: relative; z-index: 1; }

/* form for a new vehicle */
.vs-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 16px; margin-top: 4px; }
.vs-form .field.wide { grid-column: span 2; }
.vs-form-title { font-weight: 800; font-size: 13px; letter-spacing: 0.4px; color: var(--text-dim); grid-column: 1 / -1; margin-top: 6px; }
.vs-saved { display: none; align-items: center; gap: 12px; padding: 12px 16px; border: 1.5px solid var(--green); border-radius: 10px; background: rgba(34, 197, 94, 0.10); margin-top: 14px; }
.vs-saved.show { display: flex; }
.vs-err { color: #ff7b7b; font-size: 12px; margin-top: 8px; display: none; }
.vs-err.show { display: block; }
.custom-tag { display: inline-block; margin-left: 6px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.5px; padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: #4db2ff; vertical-align: middle; }

#dash .donut-wrap { gap: 12px; }
#dash .legend-list { font-size: 11.5px; }
#dash > .panel { padding: 12px 12px; }
#dash .legend-list .lg-label { min-width: 66px; }
#dash .legend-list .lg-val { margin-left: 8px; }
#dash > .panel .donut { width: 56px; height: 56px; }
#dash > .panel .donut .donut-inner { width: 40px; height: 40px; }
#dash > .panel .donut .donut-inner b { font-size: 14px; }

/* make tabs (Vehicle Setup) */
.make-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.make-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: rgba(4, 33, 58, 0.7); color: var(--text-dim); font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit; }
.make-tab span { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.make-tab:hover { color: var(--text); border-color: var(--accent); }
.make-tab.active { color: #fff; border-color: var(--accent); background: linear-gradient(180deg, #1f8af7, #0a5fc8); box-shadow: 0 0 14px rgba(18, 115, 230, 0.4); }
.make-tab.active span { background: rgba(255, 255, 255, 0.22); }
.select-card .sc-icon { height: 96px; }

/* strict side-view rig */
.rig-side { position: relative; }
.rig-side img { position: absolute; bottom: 0; height: auto; display: block; }
.rig-side .rs-trailer { z-index: 0; }
.rig-side .rs-truck { z-index: 1; }
.rig-side .rc-hoses { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
/* axle labels: all numbers on one row, each directly above its wheel; labels wrap to two lines */
.ut-mk-lbl { white-space: normal; text-align: center; width: 44px; font-size: 9.5px; letter-spacing: 0; line-height: 1.15; }

/* tire pressure top view: PSI chips over the chassis render */
.tv-wrap { position: relative; container-type: inline-size; }
.tv-wrap img { width: 100%; display: block; }
.tv-chip { position: absolute; transform: translate(-50%, -50%); width: 5.5%; height: 9.6%; min-width: 46px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; border: 0.12cqw solid #22c55e; border-radius: 0.5cqw; background: #04182f; color: #fff; font-weight: 800; font-size: 1.2cqw; white-space: nowrap; box-shadow: 0 0 0.7cqw rgba(34, 197, 94, 0.55); }
.tv-chip.yellow { border-color: var(--yellow); box-shadow: 0 0 0.7cqw rgba(245, 197, 24, 0.6); color: var(--yellow); }
.tv-chip.red { border-color: var(--red); box-shadow: 0 0 0.7cqw rgba(239, 68, 68, 0.65); color: #ff7b7b; }
.tv-pin { position: absolute; transform: translate(-50%, -50%); width: 0.95cqw; height: 0.95cqw; border-radius: 50%; background: #22c55e; border: 0.14cqw solid #fff; box-shadow: 0 0 0.6cqw #22c55e; }
.tv-pin.yellow { background: var(--yellow); box-shadow: 0 0 0.6cqw var(--yellow); }
.tv-pin.red { background: var(--red); box-shadow: 0 0 0.6cqw var(--red); }
.ut-row3 > .ut-panel:first-child { display: flex; flex-direction: column; }
.ut-row3 > .ut-panel:first-child .hero-shot-wrap { flex: 1; display: flex; align-items: center; }
.ut-row3 > .ut-panel:first-child .tv-wrap { width: 100%; }

/* composed rig (non-dry-van trailers): everything positioned in % of the rig box */
.rig-compose.rig-comp2 { position: relative; display: block; }
.rig-compose.rig-comp2 img { position: absolute; bottom: 0; height: auto; }
.rig-compose.rig-comp2 .rc-trailer { z-index: 0; }
.rig-compose.rig-comp2 .rc-truck { z-index: 1; }
.ut-hero .ut-imgbox .rig-compose { width: 100% !important; margin: 0; }
.ut-mk { height: calc(85% + 90px); }

/* fleet table: a thin full-width divider under every row */
.map-panel .data-table tbody td { box-shadow: inset 0 -1px 0 rgba(90, 160, 240, 0.28); }
.map-panel .data-table tbody tr:last-child td { box-shadow: none; }
.map-panel .data-table tbody tr:hover td { box-shadow: none; }

/* AXLEIQ logo in the sidebar */
.brand { padding: 4px 6px 18px 6px; justify-content: center; }
.brand a { display: block; width: 100%; }
.brand-logo { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 14px rgba(30, 110, 255, 0.35)); }

/* map background covers the whole (now long) fleet table: repeats down the panel, fades only at the left/right edges */
.map-panel::before {
  background: url("../assets/design/world-map.svg") center top / 100% auto repeat-y;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

/* Total Trucks / Total Trailers: the big number sits above the label (size unchanged) */
.pic-card .stat-body { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.pic-card .stat-body .stat-value { order: -1; margin: 0 0 2px; line-height: 1.05; }
/* pictures sit right on top of the number (truck/trailer bottoms aligned), card hugs its content */
#dash .pic-card { padding: 8px 14px 10px; gap: 0; }
#dash .pic-card .stat-pic { align-items: flex-end; margin-bottom: 2px; }
/* pic cards: text bottom-left, the vehicle stands bottom-right with its wheels level with the last breakdown line */
#dash .pic-card { position: relative; min-height: 104px; justify-content: flex-end; }
#dash .pic-card .stat-pic { position: absolute; left: 14px; right: 14px; bottom: 10px; width: auto; height: 84px; margin: 0; align-items: flex-end; justify-content: flex-end; z-index: 0; }
#dash .pic-card .stat-body { position: relative; z-index: 1; }
/* the tractor is a little smaller and hugs the right edge so its front wheel clears the text */
#dash .stat-card.pic-card:first-of-type .stat-pic { right: 8px; }
#dash .stat-card.pic-card:first-of-type .stat-pic img { height: 74px; width: auto; max-width: none; max-height: none; }

/* ==========================================================================================
   LOCKED (user-approved): the top stat row of Fleet Overview (Total Trucks, Total Trailers, Fleet Health,
   Overweight, Tire Pressure Low, Tire Pressure, Axle Weights) - sizes, card heights and picture positions.
   Do NOT change these rules, #dash spans (js/dash-layout.js) or the .pic-card rules above until the user says so.
   ========================================================================================== */

/* tagline under the AXLEIQ logo */
.brand-tag { display: block; margin-top: 6px; text-align: center; font-size: 8.5px; font-weight: 700; letter-spacing: 1.1px; color: #7fa6d6; white-space: nowrap; }

/* ---------------- Glide dropdowns (js/glide-menu.js) ----------------
   Glass highlight card that glides between menu options - same gradient and light
   outline as the Fleet Overview table's hover row. */
.glide-card {
  position: absolute; top: 0; left: 0; height: 0; z-index: 0; pointer-events: none; opacity: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(130, 195, 255, 0.20), rgba(50, 130, 240, 0.07));
  box-shadow: inset 0 1px 0 rgba(160, 215, 255, 0.50), inset 0 -1px 0 rgba(160, 215, 255, 0.28), inset 1px 0 0 rgba(160, 215, 255, 0.40), inset -1px 0 0 rgba(160, 215, 255, 0.40);
  transition: transform 0.2s ease, height 0.2s ease, left 0.2s ease, width 0.2s ease, opacity 0.15s ease;
}
.dd-item, .perm-option, .glide-select-opt { position: relative; z-index: 1; }
.dd-list .dd-item:not(.sel):hover, .perm-dropdown .perm-option:hover { background: transparent; }
.glide-select-menu {
  position: fixed; z-index: 1000; max-height: 300px; overflow-y: auto; box-sizing: border-box;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 6px;
  box-shadow: var(--shadow); color: var(--text); font-size: 13px;
}
.glide-select-menu::-webkit-scrollbar { width: 6px; }
.glide-select-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.glide-select-opt { padding: 8px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.glide-select-opt.is-current { color: var(--accent); font-weight: 600; }
.glide-select-opt.is-disabled { opacity: 0.45; cursor: default; }

/* sidebar nav: the glide card replaces the flat hover background; hovered link magnifies */
.sidebar .nav { position: relative; }
.sidebar .nav > .nav-link { z-index: 1; transition: background 0.15s, color 0.15s, transform 0.2s ease; }
.sidebar .nav > .nav-link:not(.active):hover { background: transparent; }
.sidebar .nav > .nav-link.glide-lens { transform: scale(1.04); color: var(--text); }
.sidebar .nav > .nav-link.active.glide-lens { color: #fff; }

/* Trucks / Trailers list: glide card replaces the flat row hover; hovered row magnifies.
   Side padding + hidden x-overflow keep the scaled row from adding a sideways scrollbar. */
#unitList { overflow-x: hidden; padding: 3px 6px; }
#unitList > .unit-row { position: relative; z-index: 1; transition: transform 0.2s ease; }
#unitList > .unit-row:not(.active):hover { background: transparent; }
#unitList > .unit-row.glide-lens { transform: scale(1.02); }

/* Pages stay hidden until js/auth-guard.js confirms a signed-in user */
html.auth-pending body { visibility: hidden; }

/* "Demo readings - not from sensors" warning (js/fleet-units.js demoReadingsNoteHtml) */
.demo-readings-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin-bottom: 14px; border-radius: 10px;
  border: 1px solid rgba(234, 179, 8, 0.45); background: var(--yellow-soft); color: var(--text); font-size: 12.5px; line-height: 1.45; }
.demo-readings-note b { color: var(--yellow); }

/* "MO" / "KOLY" tag: which MC a truck or trailer runs under (js/trucks-page.js mcChip) */
.mc-chip { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.3px; color: #9fd0ff; border: 1px solid rgba(90, 170, 255, 0.45); background: rgba(40, 140, 255, 0.10); }

/* "Ready" status (js/trucks-page.js STATUS_BADGE) */
.badge-blue { background: var(--accent-soft); color: #5aa9ff; }
.badge-blue .bd { background: #5aa9ff; box-shadow: 0 0 0 3px var(--accent-soft); }

/* Fleet Overview top row: truck / trailer numbers open those vehicles (index.html data-go) */
#dash [data-go] { cursor: pointer; border-radius: 4px; transition: color 0.15s; }
#dash [data-go]:hover { color: #9fd0ff; }
body.dash-editing #dash [data-go] { cursor: inherit; }

/* Fleet Overview table: big white unit number (no glow - user removed the white outline) */
.map-panel .unit-no, .data-table .unit-no {
  display: inline-block; font-size: 18px; font-weight: 800; letter-spacing: 0.3px; line-height: 1.15;
  color: #fff; text-decoration: none; text-shadow: none;
}
.map-panel .unit-no:hover, .data-table .unit-no:hover { color: #9fd0ff; }

/* Topbar: the company (holding) the signed-in user works under (js/auth-guard.js showCompanyBadge) */
.company-badge {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; margin-right: 6px;
  border-radius: 12px; border: 1px solid rgba(90, 170, 255, 0.45);
  background: linear-gradient(180deg, rgba(130, 195, 255, 0.16), rgba(40, 110, 220, 0.06));
  box-shadow: inset 0 1px 0 rgba(160, 215, 255, 0.35), 0 0 14px rgba(30, 130, 255, 0.22);
  white-space: nowrap; max-width: 260px;
}
.company-badge .cb-icon { width: 30px; height: 30px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #1f8af7, #0a5fc8); color: #fff; box-shadow: 0 3px 10px rgba(18, 115, 230, 0.45); }
.company-badge .cb-icon svg { width: 17px; height: 17px; }
.company-badge .cb-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.company-badge .cb-cap { font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dim); }
.company-badge .cb-name { font-size: 14px; font-weight: 800; color: #fff; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 0 8px rgba(120, 190, 255, 0.55); }
@media (max-width: 900px) { .company-badge .cb-cap { display: none; } .company-badge { max-width: 160px; } }
/* company with its own logo: the light version of the logo straight on the card (no white plate) */
.company-badge.has-logo { padding: 5px 12px; max-width: none; }
.company-badge .cb-logo { display: block; height: 30px; width: auto; max-width: 170px; }

/* ---------- live air scale panel (js/live-truck.js, unit.html) ---------- */
.live-panel { margin-bottom: 14px; }
.live-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; margin-bottom: 12px; }
.live-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.live-sub { font-size: 12px; }
.live-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--text-faint); flex: none; }
.live-dot.on { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.live-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--border); }
.live-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 16px; }
.live-ws { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.live-w { background: var(--bg-input); border: 1px solid var(--border); border-top: 3px solid var(--tone, var(--text-faint)); border-radius: 10px; padding: 10px 12px; }
.live-w.ok { --tone: var(--green); } .live-w.near { --tone: var(--yellow); } .live-w.over { --tone: var(--red); } .live-w.na { --tone: var(--text-faint); }
.live-w-name { font-size: 11px; font-weight: 800; color: var(--text-dim); letter-spacing: .3px; }
.live-w-val { font-size: 28px; font-weight: 800; color: var(--tone); font-variant-numeric: tabular-nums; margin-top: 2px; }
.live-w.na .live-w-val { color: var(--text-dim); }
.live-w-lim { font-size: 12px; color: var(--text-dim); }
.live-w-badge { font-size: 12px; font-weight: 700; color: var(--tone); margin-top: 4px; }
.live-note { font-size: 12px; color: var(--text-dim); margin: 8px 0 14px; }
.live-note b { color: var(--yellow); }
.live-chart-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.live-range { display: flex; gap: 4px; }
.live-range button { font: inherit; font-size: 11px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-dim); cursor: pointer; }
.live-range button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.live-chart { position: relative; min-height: 120px; }
.live-chart svg { display: block; max-width: 100%; }
.live-empty { padding: 30px 0; text-align: center; font-size: 12.5px; }
.lc-grid { stroke: var(--border); stroke-width: 1; }
.lc-ax { fill: var(--text-faint); font-size: 10.5px; }
.lc-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-limit { stroke: var(--red); stroke-width: 1.2; stroke-dasharray: 5 4; }
.lc-move { fill: var(--text-faint); opacity: .14; }
.lc-cross { stroke: var(--text-dim); stroke-width: 1; }
.lc-dot { fill: var(--accent); stroke: var(--bg-card); stroke-width: 2; }
.lc-tip { position: absolute; pointer-events: none; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 6px 18px rgba(0,0,0,.35); white-space: nowrap; }
.lc-tip span { color: var(--text-dim); font-size: 11px; }
.lc-legend { font-size: 11px; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.lc-key { width: 14px; height: 10px; background: var(--text-faint); opacity: .35; border-radius: 2px; display: inline-block; }
.live-map { display: flex; flex-direction: column; gap: 6px; min-height: 240px; }
.live-map iframe { flex: 1; width: 100%; min-height: 240px; border: 1px solid var(--border); border-radius: 10px; }
.live-map a { font-size: 12px; color: var(--accent); }
.live-nomap { flex: 1; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); border-radius: 10px; font-size: 12.5px; }
@media (max-width: 900px) { .live-grid { grid-template-columns: 1fr; } }

/* "..." menu on the Fleet Overview rows (settings for one truck) */
.row-menu { position: fixed; z-index: 300; min-width: 210px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.row-menu[hidden] { display: none; }
.row-menu a, .row-menu button, .row-menu .row-menu-off { display: block; width: 100%; text-align: left; padding: 9px 11px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.row-menu a:hover, .row-menu button:hover { background: var(--bg-hover); }
.row-menu .danger { color: var(--red); }
.row-menu .row-menu-off { color: var(--text-faint); cursor: default; }
/* while the row "..." menu is open the hovered row must not magnify (no moving targets under the pointer) */
.row-menu-open .map-panel .data-table tbody tr:hover { transform: none; }
.row-menu-open .map-panel .data-table tbody tr { transition: none; }

/* Truck without a trailer (js/unit-page.js bobtailAxleBlock): a big tractor, weight cards directly
   under their axles - steer under the steer axle, the two drive axles as one group "2-3". */
.ut-bob { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: end; padding: 30px 8px 6px; }
.ut-bob-truck { position: relative; width: 100%; max-width: 780px; margin: 0 auto; }
.ut-bob-pic { position: relative; }
.ut-bob-pic > img { width: 100%; display: block; }
.ut-bob-pic .ut-mk { z-index: 2; }
.ut-bob-cards { position: relative; height: 150px; margin-top: 6px; }
.ut-num.wide, .ut-mk-num.wide { width: auto; min-width: 22px; padding: 0 8px; border-radius: 14px; }
.ut-bob-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: var(--green); transform: translate(-50%, -50%); box-shadow: 0 0 8px var(--green); z-index: 2; }
.ut-bob-dot.yellow { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.ut-bob-dot.red { background: var(--red); box-shadow: 0 0 8px var(--red); }
.ut-bob .ut-gross { align-self: end; }
/* bracket for both drive wheels (one group, the "drive tandem"): its two sides start at the wheel-centre dots, stem down to the card */
.ut-bracket { position: absolute; bottom: -18px; box-sizing: border-box; border: 2px solid var(--c); border-top: 0; --c: var(--green); }
/* steer axle: line from the wheel-centre dot straight down to its card */
.ut-stem { position: absolute; bottom: -26px; width: 2px; margin-left: -1px; background: var(--c); --c: var(--green); }
.ut-stem.red { --c: var(--red); } .ut-stem.yellow { --c: var(--yellow); } .ut-stem.gray { --c: var(--text-faint); }
.ut-bracket.red { --c: var(--red); } .ut-bracket.yellow { --c: var(--yellow); } .ut-bracket.gray { --c: var(--text-faint); }
.ut-bracket::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 8px; margin-left: -1px; background: var(--c); }
@media (max-width: 1500px) { .ut-bob { grid-template-columns: 1fr; } }

/* unit.html: an axle with no weight yet (air scale not calibrated / no fresh reading) */
.ut-mk.gray { --c: var(--text-faint); }
.ut-bob-dot.gray { background: var(--text-faint); box-shadow: none; }
.ut-wcard.na { border-color: var(--border); background: rgba(255, 255, 255, 0.02); }
.ut-num.na { border-color: var(--text-faint); color: var(--text-dim); }
.ut-wval.na { font-size: 15px; color: var(--text-dim); letter-spacing: 0.3px; padding: 4px 0; }
.ut-wbadge.na { background: rgba(255, 255, 255, 0.05); color: var(--text-dim); font-size: 10.5px; }
.ut-badge-na { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 1.5px solid var(--border); border-radius: 8px; color: var(--text-dim); font-weight: 800; font-size: 15px; letter-spacing: 0.4px; }
#liveChart .live-panel { margin: 14px 0 0; }
/* truck without a trailer: truck | tire pressure (top view of the tractor) | gross weight.
   The top view gets the same width as the truck picture and sits level with it (row 1);
   the weight cards stay under the truck (row 2). */
/* wall ...500px... truck | tires | gross | wall: truck and tires together, shifted right
   (the left padding is set by fitBobTires(): 500 px on a wide screen, less on a narrow one) */
/* the truck alone 200 px further left than the tires group (the tires stay where they were) */
.ut-bob.with-tires .ut-bob-pic, .ut-bob.with-tires .ut-bob-cards { margin-right: 200px; }
.ut-bob.with-tires { grid-template-columns: auto auto 270px; justify-content: end; grid-template-rows: auto auto; align-items: start; column-gap: 28px; row-gap: 0; padding-left: 28px; padding-right: 28px; }
.ut-bob.with-tires .ut-bob-pic { width: 520px; }   /* width set by fitBobTires() */
.ut-bob.with-tires .ut-bob-truck { display: contents; }
.ut-bob.with-tires .ut-bob-pic { grid-column: 1; grid-row: 1; align-self: end; }
.ut-bob.with-tires .ut-bob-cards { grid-column: 1; grid-row: 2; }
.ut-bob.with-tires .ut-bob-tires { grid-column: 2; grid-row: 1; align-self: end; position: relative; min-width: 0; }
.ut-bob.with-tires .ut-gross { grid-column: 3; grid-row: 1 / 3; align-self: end; }
.ut-bob-tires-head { position: absolute; bottom: 100%; left: 0; margin-bottom: 10px; white-space: nowrap; }
.ut-bob-tv { width: 420px; overflow: hidden; margin: 0; }   /* width (px) set by fitBobTires(): as tall as the truck */
.ut-bob-tv > .tv-wrap { width: 200% !important; }
.ut-row3.no-topview .ut-side { flex-direction: row; }
.ut-row3.no-topview .ut-side > .panel { flex: 1; }
.ut-row3.no-topview { grid-template-columns: 1fr; }
@media (max-width: 1500px) {
  .ut-bob.with-tires .ut-bob-pic, .ut-bob.with-tires .ut-bob-cards { margin-right: 0; }
  .ut-bob.with-tires { grid-template-columns: 1fr; justify-content: stretch; }
  .ut-bob.with-tires .ut-bob-pic { width: 100%; }
  .ut-bob.with-tires .ut-bob-pic, .ut-bob.with-tires .ut-bob-cards, .ut-bob.with-tires .ut-bob-tires, .ut-bob.with-tires .ut-gross { grid-column: 1; grid-row: auto; }
  .ut-bob.with-tires .ut-bob-tires { margin-top: 40px; }
}

/* red action button (Team page: Delete) */
.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* truck without a trailer: axle weight card and tire pressure card in one line */
.ut-toprow { display: flex; gap: 18px; align-items: stretch; margin-bottom: 16px; }
.ut-toprow > .ut-panel { margin-bottom: 0; min-width: 0; }
.ut-toprow > .ut-panel:first-child { flex: 1 1 0; }
.ut-toprow > .ut-tire-panel { flex: 1 1 0; display: flex; flex-direction: column; }
.ut-toprow .ut-bob { grid-template-columns: 1fr; gap: 14px; padding: 40px 0 0; }
.ut-toprow .ut-bob .ut-gross { justify-self: stretch; }
.ut-toprow .ut-panel .flex-between { flex-wrap: wrap; gap: 10px; }
.ut-toprow .ut-bob .ut-gross { padding: 12px; }
.ut-tire-crop { flex: none; overflow: hidden; align-self: center; margin: 0; width: 70%; }
@media (max-width: 1250px) { .ut-toprow { flex-direction: column; } }

/* total weight, top right of the axle weight card */
.ut-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.ut-total { text-align: right; }
.ut-total-lbl { font-size: 12.5px; font-weight: 700; letter-spacing: 1.2px; color: var(--text-dim); }
.ut-total-val { font-size: 46px; font-weight: 800; line-height: 1.05; margin-top: 2px; }
.ut-total-val span { font-size: 22px; font-weight: 700; color: var(--text-dim); }
.ut-total-sub { font-size: 12px; color: var(--green); margin-top: 2px; }
.ut-total.over .ut-total-val { color: var(--red); }
.ut-total.over .ut-total-sub { color: var(--red); }

/* no trailer: Tire Status and Recommended Pressure Range inside the tire pressure card, under the picture */
.ut-tire-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; padding-top: 18px; }
.ut-tire-extra > .panel { margin-bottom: 0; min-width: 0; }
@media (max-width: 1500px) { .ut-tire-extra { grid-template-columns: 1fr; } }

/* green "no adjustment needed": same layout as the red recommendation */
.ut-adjust.ok .ut-arrow, .ut-adjust.ok .ut-opt-title { color: var(--green); }
.ut-adjust-body.single { grid-template-columns: 1fr; }
.ut-adjust.ok .ut-opt-text { font-size: 12px; }

/* what the law says (green "no adjustment needed" of a truck with no trailer) */
.ut-law { margin-top: 4px; }
.ut-law-title { font-size: 12px; font-weight: 800; letter-spacing: 0.4px; color: var(--green); margin-bottom: 6px; }
.ut-law-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; margin: 6px 0; color: var(--text-dim); }
.ut-law-row > :first-child { color: var(--green); flex: none; margin-top: 2px; }
.ut-law-row b { color: var(--text); }

/* axle groups under the picture (js/unit-page.js axleGroup): bracket under the wheels, name, big weight */
.ut-grps { position: absolute; left: 0; right: 0; top: 100%; height: 160px; }
.ut-bob-cards, .ut-grps { --g: var(--green); }
.ut-grp { position: absolute; top: 8px; --c: var(--green); }
.ut-grp.red { --c: var(--red); } .ut-grp.yellow { --c: var(--yellow); } .ut-grp.gray { --c: var(--text-faint); }
.ut-grp-br { position: relative; height: 14px; box-sizing: border-box; border: 2px solid var(--c); border-top: 0; }
.ut-grp-br::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 16px; margin-left: -1px; background: var(--c); }
.ut-grp-txt { position: absolute; top: 42px; left: 50%; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.ut-grp-lbl { font-size: 15px; color: var(--text-dim); }
.ut-grp-val { font-size: 38px; font-weight: 800; line-height: 1.1; }
.ut-grp-val span { font-size: 18px; font-weight: 600; color: var(--text-dim); }
.ut-grp-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.ut-grp-sub.over { color: var(--red); font-weight: 700; }
.ut-grp.red .ut-grp-val { color: #ff6b6b; }
.ut-grp-na { font-size: 15px; font-weight: 700; color: var(--text-dim); margin-top: 6px; }

/* a smaller rig picture and tire top view, so the whole overview fits one screen (fitUnitScreen) */
.ut-hero .rig-compose, .ut-hero .ut-imgbox { max-width: 900px; }
.ut-row3 > .ut-panel:first-child .tv-wrap { max-width: 900px; margin: 0 auto; }
.ut-toprow .ut-bob-pic, .ut-toprow .ut-bob-cards { max-width: 520px; margin-left: auto; margin-right: auto; width: 100%; }


.ut-head-right { gap: 8px; }

/* air scale setup from the truck page (js/unit-calibrate.js) */
.ut-grp-na[data-open-cal] { cursor: pointer; pointer-events: auto; }
.ut-grp-na u { color: var(--accent); font-weight: 600; font-size: 12.5px; }
.cal-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(2, 10, 20, 0.7); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto; }
.cal-card { width: 100%; max-width: 720px; background: var(--bg-card, #08233d); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.cal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.cal-title { font-size: 18px; font-weight: 800; }
.cal-top .icon-btn { font-size: 22px; line-height: 1; }
.cal-sec { border-top: 1px solid var(--border); padding: 14px 0 4px; margin-top: 10px; }
.cal-h { font-size: 12.5px; font-weight: 800; letter-spacing: 0.6px; color: var(--text-dim); margin-bottom: 8px; }
.cal-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cal-inline { display: flex; gap: 8px; }
.cal-inline input, .cal-fields input { background: var(--bg-input, rgba(255,255,255,0.05)); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; color: var(--text); font: inherit; width: 100%; box-sizing: border-box; }
.cal-inline input { max-width: 260px; }
.cal-status { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; }
.cal-status.calibrated, .cal-status.verified { border-color: var(--green); background: rgba(34, 197, 94, 0.08); }
.cal-status.one, .cal-status.estimate { border-color: var(--yellow); background: rgba(245, 158, 11, 0.08); }
.cal-status span { color: var(--text-dim); font-size: 12px; }
.cal-psi { padding: 8px 10px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.cal-psi.ok { background: rgba(34, 197, 94, 0.1); }
.cal-psi.bad { background: rgba(239, 68, 68, 0.1); color: #ff8a8a; }
.cal-psi span { color: var(--text-dim); }
.cal-seg { display: flex; gap: 8px; margin-bottom: 10px; }
.cal-seg label { flex: 1; }
.cal-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cal-seg span { display: block; text-align: center; padding: 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.cal-seg input:checked + span { border-color: var(--accent); background: rgba(40, 140, 255, 0.15); font-weight: 700; }
.cal-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cal-fields label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.cal-fields label[hidden] { display: none; }
.cal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.cal-tickets { margin-top: 14px; font-size: 12.5px; }
@media (max-width: 600px) { .cal-fields { grid-template-columns: 1fr; } }
.live-empty-panel .live-map { min-height: 0; }
.live-empty-panel .live-chart { min-height: 0; }
.live-empty-panel .live-empty, .live-empty-panel .live-nomap { padding: 18px 0; text-align: center; }

/* Tire Status + Recommended Pressure Range: compact, so the tire picture can be as big as the rig picture */
.ut-tire-extra { gap: 10px; }
.ut-tire-extra .panel { padding: 9px 13px; }
.ut-tire-extra .panel-title { font-size: 12.5px !important; margin-bottom: 4px; }
.ut-tire-extra .donut { width: 62px !important; height: 62px !important; }
.ut-tire-extra .donut-inner { width: 44px !important; height: 44px !important; }
.ut-tire-extra .donut-inner b { font-size: 14px; }
.ut-tire-extra .donut-inner span { font-size: 8px; }
.ut-tire-extra .lg-row { font-size: 11px; padding: 0; }
.ut-tire-extra .summary-row { font-size: 11.5px; padding: 3px 0; }
.ut-tire-extra .mini-note { display: none; }

/* plain tip about which slides this trailer has */
.ut-tip { margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; background: rgba(255, 255, 255, 0.05); color: var(--text); }

/* a slide that does not help with this overweight: same picture, dimmed */
.ut-adjust .ut-opt.dim { opacity: 0.65; }
.ut-adjust .ut-opt.dim .ut-opt-title, .ut-adjust .ut-opt.dim .ut-arrow { color: var(--text-dim); }

/* weight problems on record (js/unit-incidents.js), inside the Adjustment Guide */
.inc { margin-top: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(239, 68, 68, 0.55); background: rgba(239, 68, 68, 0.08); font-size: 12.5px; line-height: 1.45; }
.inc-title { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; color: #ff7b7b; margin-bottom: 4px; }
.inc-meta { color: var(--text-dim); font-size: 11.5px; }
.inc-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0; color: var(--text-dim); }
.inc-nums b { color: var(--text); }
.inc-fix { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.inc-btns { display: flex; gap: 8px; margin-top: 8px; }
.inc-area { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.inc-area textarea, .cal-fields input[type=date], .cal-fields input:not([type]) { background: var(--bg-input, rgba(255,255,255,0.05)); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; color: var(--text); font: inherit; width: 100%; box-sizing: border-box; }

/* Recommended adjustment: a status line, then one card per slide (fifth wheel | tandem), notes underneath */
.ut-adj { margin-bottom: 16px; }
.ut-adj-head { display: flex; align-items: center; gap: 12px; color: var(--red); margin: 0 4px 10px; }
.ut-adj-head.ok { color: var(--green); }
.ut-adj-head.na { color: var(--text-dim); }
.ut-adj .ut-row2 { grid-template-columns: 1fr; margin-bottom: 0; }
.ut-adj .ut-row2.two { grid-template-columns: 1fr 1fr; }
.ut-adj .ut-adjust-body.single { margin-top: 0; }
.ut-adjust.na { border-color: var(--border); background: rgba(255, 255, 255, 0.03); }
.tab-panel > .ut-adjust { margin-bottom: 14px; }

/* bigger hint text in the fifth wheel / tandem cards, easy to read at a glance */
.ut-adj .ut-tip { font-size: 16px; line-height: 1.55; padding: 12px 14px; margin-top: 12px; }
.ut-adj .ut-tip b { font-size: 16.5px; }
.ut-adj .ut-fix-in-card { font-size: 17px; line-height: 1.6; }
.ut-adj .ut-opt-text { font-size: 14px; line-height: 1.5; }
.ut-adj .ut-opt-title { font-size: 16px; }

/* a bit bigger truck + trailer picture (and the tire picture that follows its size) */
.ut-toprow .ut-hero { padding-left: 0; padding-right: 0; }
.ut-toprow .ut-hero .rig-compose, .ut-toprow .ut-hero .ut-imgbox { width: 98% !important; max-width: none; }
.ut-toprow .ut-bob-pic, .ut-toprow .ut-bob-cards { max-width: 640px; }

/* "fix it before the next scale" banner (js/fine-banner.js): unit.html above the truck picture and the driver app */
.fine-banner { margin: 10px 0 6px; padding: 12px 16px; border-radius: 10px; border: 1.5px solid var(--red, #ef4444); background: rgba(239, 68, 68, 0.12); text-align: center; }
.fine-title { font-size: 15px; font-weight: 800; letter-spacing: 0.6px; color: #ff6b6b; }
.fine-line { font-size: 20px; font-weight: 700; margin-top: 4px; }
.fine-amt { color: #ff6b6b; font-size: 26px; font-weight: 800; }
.fine-sub { font-size: 12.5px; opacity: 0.8; margin-top: 4px; line-height: 1.45; }
.fine-law { margin-top: 6px; font-size: 12px; text-align: left; opacity: 0.85; }
.fine-law summary { cursor: pointer; text-align: center; }

/* arrow opposite the drive axles: which way to slide the trailer tandem (js/unit-page.js heroBlock) */
.ut-mv { position: absolute; top: 128px; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.ut-mv svg { display: block; margin: 0 auto; }
.ut-mv path { stroke: var(--red, #ef4444); stroke-width: 5; stroke-linecap: round; fill: none; }
.ut-mv polygon { fill: var(--red, #ef4444); }
.ut-mv-txt { font-size: 12.5px; font-weight: 800; letter-spacing: 0.4px; color: #ff6b6b; margin-top: 2px; }

/* the arrow sits in the gap between the drive and trailer brackets, same row as the brackets */
.ut-mv { top: 0; transform: none; text-align: center; white-space: normal; }
.ut-mv svg { width: 100%; max-width: 200px; height: auto; display: block; margin: 0 auto; }
.ut-mv-txt { white-space: normal; line-height: 1.2; }

/* the tandem arrow blinks so it is noticed (and stays still for people who turn animations off) */
@keyframes ut-mv-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
.ut-mv { animation: ut-mv-blink 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ut-mv { animation: none; } }

/* the arrow hugs the trailer tandem side of the gap */
.ut-mv { text-align: right; }
.ut-mv svg { margin: 0 0 0 auto; }
.ut-mv-txt { padding-right: 2px; }

/* the fine warning sits in the header of the weight card, in the empty space between the title and the total weight */
.ut-head-mid { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; align-self: stretch; padding: 0 14px; }
.ut-head-mid .fine-banner { margin: 0; padding: 8px 14px; align-self: flex-start; max-width: 520px; width: 100%; box-sizing: border-box; }
.ut-head-mid .fine-title { font-size: 13px; }
.ut-head-mid .fine-line { font-size: 16px; margin-top: 2px; }
.ut-head-mid .fine-amt { font-size: 22px; }
.ut-head-mid .fine-sub { font-size: 11px; margin-top: 2px; }
.ut-head-mid .fine-sub { display: none; }
.ut-head-mid .fine-law { text-align: center; }
.ut-head-mid .fine-banner { margin-top: 26px; }

/* Tire Status + Recommended Pressure Range: bigger text again (the card may grow downward; the tire picture keeps its size) */
.ut-tire-extra { gap: 14px; padding-top: 22px; }
.ut-tire-extra .panel { padding: 14px 18px; }
.ut-tire-extra .panel-title { font-size: 17px !important; margin-bottom: 8px; }
.ut-tire-extra .donut { width: 100px !important; height: 100px !important; }
.ut-tire-extra .donut-inner { width: 74px !important; height: 74px !important; }
.ut-tire-extra .donut-inner b { font-size: 24px; }
.ut-tire-extra .donut-inner span { font-size: 11px; }
.ut-tire-extra .lg-row { font-size: 15px; padding: 2px 0; }
.ut-tire-extra .summary-row { font-size: 15.5px; padding: 6px 0; }
.ut-tire-extra .mini-note { display: block; font-size: 12.5px; }

.ut-mv-sub { font-size: 11.5px; line-height: 1.3; color: var(--text-dim); margin-top: 2px; }

/* only the arrow blinks; the words under it stay still and a bit bigger */
.ut-mv { animation: none; }
.ut-mv svg { animation: ut-mv-blink 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ut-mv svg { animation: none; } }
.ut-mv-txt { font-size: 14.5px; }
.ut-mv-sub { font-size: 14px; line-height: 1.35; color: var(--text); opacity: 0.9; }

/* tire top view aligned under the truck picture's axles (js/unit-page.js topViewHtml), like the driver app */
.drv-tv-clip { overflow: hidden; }
.ut-tire-crop .tv-wrap { max-width: none; }

/* staging.axle-iq.com / staging APK: a corner label so test data is never taken for the live fleet (js/supabase-client.js) */
.env-badge { position: fixed; left: 50%; top: 0; transform: translateX(-50%); z-index: 9999; padding: 3px 14px; border-radius: 0 0 8px 8px;
  background: var(--yellow); color: #1a1200; font-size: 11px; font-weight: 800; letter-spacing: 2px; pointer-events: none; }
