.insights-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.main:has(.insights-shell--fleet-required) {
  display: flex;
  flex-direction: column;
}

.main:has(.insights-shell--fleet-required) .page {
  display: flex;
  flex: 1;
  flex-direction: column;
  box-sizing: border-box;
}

.main:has(.insights-shell--fleet-required) .page-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: 16px;
}

.insights-shell--fleet-required {
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
}

.insights-fleet-required {
  text-align: center;
  max-width: 640px;
  padding: 32px 24px;
}

.insights-fleet-required__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

.insights-fleet-required__body {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
}

.insights-page-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid #0072ce;
  border-radius: 8px;
  background: #f0f6ff;
  font-size: 14px;
  line-height: 1.6;
}

.insights-page-alert p {
  margin: 0;
}

.insights-page-alert img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.insights-page-tabs {
  display: flex;
  gap: 32px;
}

.insights-page-tab {
  margin: 0;
  padding: 12px 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
}

.insights-page-tab.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.insights-panel {
  background: var(--white);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(29, 42, 52, 0.06);
}

.insights-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.insights-panel__title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
}

.insights-panel__title--solo {
  margin-bottom: 16px;
}

.insights-filters {
  display: flex;
  gap: 12px;
}

.insights-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 122px;
  height: 48px;
  padding: 8px 12px 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
}

.insights-field--wide {
  min-width: 250px;
}

.insights-field__label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
}

.insights-field__value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 1.6;
}

.insights-field__value img {
  width: 16px;
  height: 16px;
}

.insights-field-wrap {
  position: relative;
}

.insights-field--btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.insights-field--btn.is-open {
  border-color: var(--brand);
}

.insights-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 12px rgba(29, 42, 52, 0.06);
  overflow: hidden;
}

.insights-dropdown-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.insights-dropdown-item:last-child {
  border-bottom: none;
}

.insights-dropdown-item.is-selected {
  background: #f0f6ff;
  font-weight: 500;
}

.insights-dropdown-item:hover {
  background: var(--brand-100);
}

.insights-dropdown-item.is-selected:hover {
  background: var(--brand-100);
}

.insights-chart__avg--electric {
  border-top-color: #0072ce;
}

.insights-panel--electric .insights-chart-card {
  margin-bottom: 0;
}

.insights-kpi-grid--electric {
  margin-top: 16px;
}

.insights-chart-card {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.insights-chart-card__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.insights-chart {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.insights-chart__axis {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

.insights-chart__plot {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 280px;
}

.insights-chart__body {
  position: relative;
  flex: 1;
  min-height: 220px;
}

.insights-chart__grid {
  position: absolute;
  inset: 0 0 0 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.insights-chart__grid span {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.insights-chart__grid span::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.insights-chart__bars {
  position: absolute;
  inset: 0 0 0 72px;
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.insights-chart__x-labels {
  display: flex;
  flex-shrink: 0;
  gap: 16px;
  margin-top: 12px;
  padding-left: 72px;
  padding-right: 0;
}

.insights-chart__x-labels .insights-bar__label {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.insights-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.insights-bar-slot {
  min-height: 0;
  width: 100%;
}

.insights-bar-slot--value {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.insights-bar-slot--value .insights-bar {
  flex: 1;
  min-height: 0;
}

.insights-bar {
  width: 100%;
  max-width: 100%;
  border-radius: 4px 4px 0 0;
  background: #59b9ff;
  min-height: 0;
}

.insights-bar--fuel {
  background: #ffeb64;
}

.insights-bar--electric {
  background: #00bacd;
}

.insights-chart__avg--fuel {
  bottom: 50%;
}

.insights-bar__label {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
}

.insights-chart__avg {
  position: absolute;
  left: 72px;
  right: 0;
  bottom: 20%;
  border-top: 1px dashed #0072ce;
  pointer-events: none;
}

.insights-chart__avg span {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  background: var(--white);
  padding: 0 4px;
}

.insights-metrics-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.insights-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.insights-kpi {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 16px;
}

.insights-kpi-grid--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.insights-kpi-grid--eight {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.insights-kpi__delta--up {
  color: #c0392b;
}

.insights-callout--compact .insights-callout__head {
  margin-bottom: 0;
}

.insights-idle-panel {
  --idle-label-col: 254px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.insights-idle-body {
  position: relative;
}

.insights-idle-pairs {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insights-idle-pair {
  display: grid;
  grid-template-columns: var(--idle-label-col) 1fr;
  gap: 16px;
  align-items: center;
}

.insights-idle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.insights-idle-row img {
  width: 80px;
  height: 49px;
  object-fit: contain;
  flex-shrink: 0;
}

.insights-idle-row__name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.insights-idle-row__sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.insights-idle-chart-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: calc(var(--idle-label-col) + 16px);
  pointer-events: none;
}

.insights-idle-chart__grid {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to right,
    transparent,
    transparent calc(14.28% - 1px),
    var(--hairline) calc(14.28% - 1px),
    var(--hairline) 14.28%
  );
  opacity: 0.6;
}

.insights-idle-bar-row {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 16px;
}

.insights-idle-foot {
  display: grid;
  grid-template-columns: var(--idle-label-col) 1fr;
  gap: 16px;
  align-items: end;
}

.insights-idle-foot__spacer {
  min-width: 0;
}

.insights-idle-bar {
  height: 16px;
  border-radius: 0 4px 4px 0;
  background: #ff7872;
  min-width: 8px;
}

.insights-idle-chart__avg {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed var(--ink);
  z-index: 2;
  pointer-events: none;
}

.insights-idle-chart__avg span {
  position: absolute;
  top: 40%;
  left: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.insights-idle-chart__x {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.insights-idle-chart__axis-label {
  grid-column: 2;
  justify-self: end;
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.insights-empty--idle {
  grid-column: 1 / -1;
}

.insights-idle-panel--chart {
  margin-top: 0;
}

.insights-idle-split {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.insights-idle-split__list {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insights-idle-loc-card {
  margin: 0;
  padding: 20px 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface, #fff);
}

.insights-idle-loc-card__body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.insights-idle-loc-card__stats {
  flex: 0 0 auto;
  min-width: 107px;
}

.insights-idle-duration {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: #cc0300;
}

.insights-idle-loc-card__events {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.4;
}

.insights-idle-loc-card__place {
  flex: 1 1 0;
  min-width: 0;
}

.insights-idle-loc-card__place--right {
  text-align: right;
}

.insights-idle-loc-card__name {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.insights-idle-loc-card__vehicles {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.4;
}

.insights-idle-map {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 504px;
  border-radius: 12px;
  overflow: hidden;
}

.insights-idle-map__base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.insights-idle-map__pin {
  position: absolute;
  width: 100px;
  height: 100px;
  margin: -50px 0 0 -50px;
  pointer-events: none;
}

.insights-idle-map__halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(204, 3, 0, 0.12);
}

.insights-idle-map__badge {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 20px;
  background: #cc0300;
}

.insights-idle-events-side {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 8px 16px 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.insights-idle-events-side__head {
  text-align: center;
}

.insights-idle-events-side__savings {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.5;
}

.insights-idle-events-side__savings strong {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.3;
  color: #008035;
}

.insights-idle-events-side__filter {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.insights-idle-events-side__pill {
  display: inline-block;
  margin: 0 4px;
  padding: 2px 8px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
}

.insights-idle-events-side__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.insights-idle-events-side__legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.insights-idle-events-side__swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  font-style: normal;
}

.insights-idle-events-side__swatch--long {
  background: #2e844a;
}

.insights-idle-events-side__swatch--short {
  background: #c9d9e8;
}

.insights-idle-events-side__cost-line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
}

.insights-idle-events-side__cost-line::before,
.insights-idle-events-side__cost-line::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--hairline);
}

.insights-idle-events-side__cost-label {
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.insights-idle-events-side__bars {
  display: flex;
  gap: 0;
  min-height: 123px;
  border-radius: 8px;
  overflow: hidden;
}

.insights-idle-events-side__bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 24px 8px;
  color: #fff;
  text-align: center;
}

.insights-idle-events-side__bar--long {
  background: #2e844a;
}

.insights-idle-events-side__bar--short {
  background: #8fa8bc;
}

.insights-idle-events-side__bar-value {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.3;
}

.insights-idle-events-side__bar-value::before {
  content: "$";
  font-size: 14px;
  vertical-align: super;
}

.insights-idle-events-side__bar-pct {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

.insights-idle-events-side__table {
  border-top: 1px solid var(--hairline);
}

.insights-idle-events-side__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-size: 14px;
  line-height: 1.5;
  border-bottom: 1px solid var(--hairline);
}

.insights-idle-events-side__row--head {
  font-weight: 500;
}

.insights-idle-events-side__row:last-child {
  border-bottom: none;
}

@media (max-width: 960px) {
  .insights-idle-split {
    flex-direction: column;
  }

  .insights-idle-map {
    min-height: 320px;
  }
}

.insights-kpi__label {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--muted);
}

.insights-kpi__value {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.3;
}

.insights-kpi__suffix {
  font-size: 12px;
  line-height: 1.4;
  margin-left: 4px;
}

.insights-kpi__delta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--muted);
}

.insights-kpi__delta img {
  width: 10px;
  height: 10px;
}

.insights-callout {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid #0072ce;
  border-radius: 8px;
  background: #f0f6ff;
}

.insights-callout__head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.insights-callout__head p {
  margin: 0;
}

.insights-callout__head img {
  width: 16px;
  height: 16px;
}

.insights-callout__body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.insights-card-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.insights-card-tab {
  margin: 0 0 -1px;
  padding: 12px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
}

.insights-card-tab.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.insights-util-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.insights-util-col__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.insights-util-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insights-vehicle {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--white);
}

.insights-vehicle img {
  width: 80px;
  height: 49px;
  object-fit: contain;
  flex-shrink: 0;
}

.insights-vehicle__meta {
  flex: 1;
  min-width: 0;
}

.insights-vehicle__name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.insights-vehicle__sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.insights-vehicle__stats {
  width: 148px;
  text-align: right;
}

.insights-vehicle__days {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.insights-vehicle__miles {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

.insights-empty {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1100px) {
  .insights-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insights-kpi-grid--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .insights-util-cols {
    grid-template-columns: 1fr;
  }

  .insights-panel__head {
    flex-direction: column;
    align-items: flex-start;
  }
}
