:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f6f8;
  color: #18212f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

body.loginRequired header,
body.loginRequired main {
  display: none;
}

.loginScreen {
  align-items: center;
  background: #f4f6f8;
  display: grid;
  min-height: 100vh;
  padding: 18px;
}

.loginScreen[hidden] {
  display: none;
}

.loginCard {
  background: #ffffff;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  box-shadow: 0 18px 32px rgba(24, 33, 47, 0.14);
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 420px;
  padding: 22px;
  width: 100%;
}

.loginCard p {
  color: #526273;
  margin-top: 4px;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d7dde5;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 16px 24px;
}

.menuButton {
  align-items: center;
  background: #ffffff;
  border: 1px solid #c7d0db;
  display: grid;
  gap: 4px;
  height: 40px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 44px;
}

.menuButton span {
  background: #18212f;
  display: block;
  height: 2px;
  width: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
}

h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

.online {
  color: #087443;
}

.offline {
  color: #a23622;
}

.session {
  align-items: center;
  display: flex;
  gap: 8px;
}

.sessionLabel {
  color: #526273;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

main {
  display: block;
  gap: 18px;
  padding: 18px;
  position: relative;
}

.appMenu {
  background: #ffffff;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  box-shadow: 0 18px 32px rgba(24, 33, 47, 0.18);
  display: none;
  left: 18px;
  overflow: hidden;
  position: absolute;
  top: 18px;
  width: 220px;
  z-index: 20;
}

.appMenu.open {
  display: grid;
}

.workspace,
.side {
  background: #ffffff;
  border: 1px solid #d7dde5;
  border-radius: 6px;
}

.side {
  padding: 16px;
}

.tab {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d7dde5;
  color: #4b5b6d;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  text-align: left;
  min-height: 46px;
  padding: 0 18px;
}

.tab.active {
  background: #e7f0ed;
  color: #163c34;
  font-weight: 700;
}

.notificationBadge {
  align-items: center;
  background: #b3261e;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  display: inline-grid;
  font-size: 11px;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  line-height: 1;
  min-width: 20px;
  padding: 0 5px;
  position: absolute;
  right: -8px;
  top: -8px;
}

.notificationBadge[hidden] {
  display: none;
}

.inlineBadge {
  border: 0;
  height: 18px;
  min-width: 18px;
  padding: 0 5px;
  position: static;
}

select {
  border: 1px solid #c7d0db;
  border-radius: 6px;
  font: inherit;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.panel {
  display: none;
  padding: 18px;
}

.panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  color: #526273;
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
}

input,
textarea,
button {
  border-radius: 6px;
  font: inherit;
}

input,
textarea {
  border: 1px solid #c7d0db;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  margin-top: 14px;
  resize: vertical;
}

button {
  background: #18625a;
  border: 1px solid #14544d;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 8px 14px;
}

form > button,
.panel > button {
  margin-top: 16px;
}

.segmented {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.segmented label {
  align-items: center;
  border: 1px solid #c7d0db;
  border-radius: 6px;
  color: #18212f;
  display: flex;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
}

.segmented input {
  min-height: auto;
  width: auto;
}

.list {
  display: grid;
  gap: 8px;
}

.row {
  border: 1px solid #d7dde5;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.compact .row {
  padding: 9px 10px;
}

.row span {
  color: #334456;
}

.row small {
  color: #69798b;
  overflow-wrap: anywhere;
}

.row em {
  color: #a23622;
  font-style: normal;
}

.queueItem {
  gap: 8px;
}

.queueActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.queueActions button {
  min-height: 34px;
  padding: 6px 10px;
}

.empty {
  color: #69798b;
  padding: 8px 0;
}

.activeQrCard {
  align-items: center;
  border: 2px solid #18625a;
  border-radius: 6px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-bottom: 16px;
  padding: 14px;
}

.activeQrCard[hidden] {
  display: none;
}

.activeQrCard div {
  display: grid;
  gap: 4px;
}

.activeQrCard span {
  color: #526273;
  overflow-wrap: anywhere;
}

.activeQrCard img {
  grid-column: 3;
  height: 180px;
  width: 180px;
}

.activeQrCard .iconButton {
  background: #ffffff;
  color: #14544d;
  min-height: 34px;
  padding: 6px 10px;
}

.qrStage {
  align-items: center;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: 16px;
  min-height: 320px;
  padding: 18px;
}

.qrStage img {
  height: 260px;
  width: 260px;
}

.scannerShell {
  display: grid;
  gap: 12px;
}

.scannerShell video {
  aspect-ratio: 4 / 3;
  background: #18212f;
  border-radius: 6px;
  max-height: 420px;
  object-fit: cover;
  width: 100%;
}

.scannerActions,
.tripActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#scanForm {
  margin-top: 16px;
}

.utilityPanel {
  display: none;
}

.utilityPanel.active {
  display: block;
}

.tripDetails {
  display: grid;
  gap: 16px;
}

.tripHeader {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.tripHeader p {
  color: #526273;
  overflow-wrap: anywhere;
}

.detailGrid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detailGrid article {
  border: 1px solid #d7dde5;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.detailGrid span {
  color: #526273;
  font-size: 13px;
  font-weight: 600;
}

.detailGrid strong {
  overflow-wrap: anywhere;
}

.overviewGrid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.overviewVehiclesList {
  margin-bottom: 18px;
}

.overviewMetric {
  background: #ffffff;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  color: #18212f;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 14px;
  text-align: left;
}

button.overviewMetric {
  cursor: pointer;
}

button.overviewMetric:hover {
  border-color: #18625a;
  box-shadow: 0 0 0 2px rgba(24, 98, 90, 0.12);
}

.overviewGrid strong {
  font-size: 28px;
}

.overviewGrid span,
.helpList p {
  color: #526273;
}

.overviewControls {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 360px) auto;
  margin-bottom: 14px;
}

.overviewControls button {
  min-height: 40px;
}

.helpList {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.results {
  margin-top: 16px;
}

.suggestionGrid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.suggestionGrid h2 {
  color: #526273;
  font-size: 13px;
  margin-bottom: 8px;
}

.suggestions {
  display: grid;
  gap: 8px;
}

.suggestion {
  background: #ffffff;
  border: 1px solid #c7d0db;
  color: #18212f;
  display: grid;
  gap: 2px;
  justify-items: start;
  min-height: 52px;
  text-align: left;
  width: 100%;
}

.suggestion:hover {
  background: #eef5f3;
}

.suggestion span,
.selectedMatch {
  color: #526273;
  font-size: 13px;
}

.selectedMatch {
  border: 1px solid #b7d7ca;
  border-radius: 6px;
  margin: 0;
  padding: 10px 12px;
}

.linkedPrompt {
  border: 1px solid #b7d7ca;
  border-radius: 6px;
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
}

.linkedPrompt[hidden] {
  display: none;
}

.linkedPrompt h2 {
  margin-bottom: 4px;
}

.linkedPrompt p {
  color: #526273;
}

.linkedPrompt > button {
  justify-self: start;
  margin-top: 0;
}

.hiddenUtility {
  display: none;
}

.toast {
  background: #18212f;
  border-radius: 6px;
  bottom: 18px;
  color: #ffffff;
  left: 50%;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  transform: translateX(-50%);
  transition: opacity 160ms ease;
}

.toast.visible {
  opacity: 1;
}

@media (max-width: 900px) {
  .topbar,
  .session {
    align-items: stretch;
    flex-direction: column;
  }

  main {
    grid-template-columns: 1fr;
  }

  .appMenu {
    left: 18px;
    right: 18px;
    width: auto;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .overviewGrid {
    grid-template-columns: 1fr;
  }

  .overviewControls {
    grid-template-columns: 1fr;
  }

  .detailGrid {
    grid-template-columns: 1fr;
  }

  .tripHeader {
    display: grid;
  }

  .suggestionGrid {
    grid-template-columns: 1fr;
  }

  .activeQrCard {
    justify-items: center;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .activeQrCard img {
    grid-column: auto;
  }
}
