/* CrewHQ Home: a compact, route-first daily command center. */
#appView #home.homeWorkspace {
  min-width: 0;
  padding-bottom: 22px;
}

#appView #home .homePageHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 20px;
}

#appView #home .homeTitleCopy,
#appView #home .homeCommandCopy,
#appView #home .homeRouteHeading,
#appView #home .homeRouteInfo,
#appView #home .homeRecentHeader > div {
  min-width: 0;
}

#appView #home .homeTitleCopy > span,
#appView #home .homeSectionEyebrow,
#appView #home .homeRouteEyebrow,
#appView #home .homeRouteListEyebrow,
#appView #home .homeQuietEyebrow {
  display: block;
  color: #438d45;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
}

#appView #home .homeTitleCopy h1 {
  margin: 5px 0 0;
  color: #10263a;
  font-size: clamp(30px, 4.8vw, 38px);
  font-weight: 930;
  letter-spacing: -1.35px;
  line-height: 1.08;
}

#appView #home .homeTitleCopy > p {
  margin: 6px 0 0;
  color: #738079;
  font-size: 11px;
  line-height: 1.45;
}

#appView #home .homeDateBadge {
  flex: 0 0 auto;
  padding: 9px 11px;
  border: 1px solid #e3eae4;
  border-radius: 12px;
  background: #fff;
  color: #52635b;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

#appView #home .homeCommandDeck {
  position: relative;
  margin: 0 0 16px;
  padding: 25px 25px 22px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(138deg, #10263a 0%, #173847 69%, #245148 100%);
  box-shadow: 0 18px 40px rgb(16 38 58 / 15%);
}

#appView #home .homeCommandDeck::after {
  top: -115px;
  right: -80px;
  width: 245px;
  height: 245px;
  background: rgb(84 185 72 / 11%);
}

#appView #home .homeCommandTop,
#appView #home .homeHeroActions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 13px;
}

#appView #home .homeCommandTop {
  align-items: flex-start;
}

#appView #home .homeCommandCopy > .eyebrow {
  margin: 0 0 10px;
  color: #97d68b;
  font-size: 9px;
  letter-spacing: .14em;
}

#appView #home #heroGreeting {
  margin: 0;
  color: #fff;
  font-size: clamp(25px, 5vw, 36px);
  font-weight: 930;
  letter-spacing: -1.25px;
  line-height: 1.12;
}

#appView #home .homeHeroSubtitle {
  max-width: 420px;
  margin: 8px 0 0;
  color: #c0cec7;
  font-size: 11px;
  line-height: 1.55;
}

#appView #home .homeDayStatus {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
  color: #edf5ee;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

#appView #home .homeDayStatus > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6fcd66;
  box-shadow: 0 0 0 4px rgb(111 205 102 / 11%);
}

#appView #home .homeHeroActions {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 21px;
}

#appView #home .homeNewJob,
#appView #home .homeHeroSchedule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 41px;
  border: 0;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 850;
}

#appView #home .homeNewJob {
  width: auto;
  padding: 0 14px;
  background: #fff;
  color: #10263a;
}

#appView #home .homeNewJob > span {
  font-size: 15px;
}

#appView #home .homeHeroSchedule {
  padding: 0 11px;
  background: rgb(255 255 255 / 10%);
  color: #fff;
}

#appView #home .homeMetrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 13px;
}

#appView #home .homeMetric {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  padding: 14px 13px 13px;
  border: 1px solid #e6ece7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 17px rgb(16 38 58 / 3%);
}

#appView #home .homeMetric[hidden],
#appView #home .homeNewJob[hidden],
#appView #home #goInvoices[hidden] {
  display: none !important;
}

#appView #home .homeMetricIcon,
#appView #home .homeQuietIcon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
}

#appView #home .homeMetricIcon {
  width: 30px;
  height: 30px;
  margin: 0;
  background: #edf5ed;
  color: #397e45;
}

#appView #home .homeMetricIconInvoice {
  background: #f9f2e7;
  color: #96713c;
}

#appView #home .homeMetricIconRevenue {
  background: #ebf0f7;
  color: #426481;
}

#appView #home .homeMetricIcon svg,
#appView #home .homeQuietIcon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#appView #home .homeMetric b {
  overflow: hidden;
  font-size: clamp(18px, 4.8vw, 27px);
  font-weight: 920;
  letter-spacing: -.85px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appView #home .homeMetric > span:last-child {
  overflow: hidden;
  margin: 0;
  color: #718077;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

#appView #home #plannerOverdueHome {
  margin-block: 0 13px;
}

#appView #home .homeRoutePanel {
  gap: 0;
  margin: 0 0 23px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid #e3eae4;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 25px rgb(16 38 58 / 4%);
}

#appView #home .homeRouteHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

#appView #home .homeRouteHead h2 {
  margin: 6px 0 0;
  color: #10263a;
  font-size: clamp(19px, 4vw, 23px);
  font-weight: 900;
  letter-spacing: -.55px;
  line-height: 1.1;
}

#appView #home .homeRouteSummary {
  margin: 5px 0 0;
  color: #738079;
  font-size: 10px;
  line-height: 1.5;
}

#appView #home .homeRouteBadge {
  flex: 0 0 auto;
  margin-top: 3px;
  padding: 7px 9px;
  border-radius: 999px;
  background: #edf5ec;
  color: #357c42;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

#appView #home .homeRoutePanel.is-empty .homeRouteBadge {
  background: #f1f4f1;
  color: #637169;
}

#appView #home .homeRouteBody {
  display: grid;
  gap: 13px;
  min-width: 0;
}

#appView #home .homeRouteCanvas {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 202px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e7eee8;
  border-radius: 16px;
  background: linear-gradient(145deg, #f8faf8 0%, #eef4ef 100%);
}

#appView #home .homeRouteCanvas .leaflet-container {
  z-index: 0;
}

#appView #home .homeRoutePanel.is-empty .homeRouteCanvas {
  display: grid;
  height: auto;
  min-height: 146px;
  max-height: 173px;
  place-items: center;
}

#appView #home .homeRouteStops {
  min-width: 0;
}

#appView #home .homeRoutePanel.is-empty .homeRouteStops {
  display: none;
}

#appView #home .homeRouteStopsHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  margin-bottom: 5px;
}

#appView #home .homeRouteScheduleLink {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #428a48;
  font-size: 10px;
  font-weight: 800;
}

#appView #home .homeRouteList {
  display: grid;
  gap: 8px;
  margin: 0;
}

#appView #home .homeRouteStop {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 9px 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e7ede8;
  border-radius: 15px;
  background: #fbfcfb;
}

#appView #home .homeRouteStop:first-child {
  border-color: #dbead9;
  background: #f6faf5;
}

#appView #home .homeRouteStopNum {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 11px;
  background: #eaf1eb;
  color: #355c45;
  font-size: 11px;
  font-weight: 900;
}

#appView #home .homeRouteStop:first-child .homeRouteStopNum {
  background: #10263a;
  color: #fff;
}

#appView #home .homeRouteInfo > strong {
  display: block;
  overflow: hidden;
  color: #10263a;
  font-size: 12px;
  font-weight: 840;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appView #home .homeRouteInfo > span {
  display: block;
  margin-top: 3px;
  color: #728077;
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#appView #home .homeRouteInfo > .homeRouteTime {
  color: #3b8648;
  font-weight: 850;
}

#appView #home .routeRowActions {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 7px;
  margin: 1px 0 0;
}

#appView #home .routeDirectionBtn,
#appView #home .homeFinishBtn {
  min-height: 37px;
  padding: 8px 9px !important;
  border-radius: 10px !important;
  font-size: 10px !important;
}

#appView #home .routeDirectionBtn {
  background: #edf2ed;
}

#appView #home .routeNextApps {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

#appView #home .routeNextApps.hidden {
  display: none !important;
}

#appView #home .routeNextApps a {
  display: grid;
  min-height: 34px;
  padding: 6px 4px !important;
  place-items: center;
  border-radius: 9px !important;
  font-size: 8px !important;
  text-decoration: none;
}

#appView #home .homeRouteNote {
  margin: 11px 0 0;
  color: #7b877f;
  font-size: 9px;
  line-height: 1.5;
}

#appView #home .homeRoutePanel.is-empty .homeRouteNote {
  margin-top: 10px;
}

#appView #home .noJobsState,
#appView #home .homeQuietState {
  display: grid;
  width: 100%;
  min-height: 0;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 17px 12px;
  border: 0;
  background: transparent;
  text-align: center;
}

#appView #home .homeQuietIcon,
#appView #home .noJobsMachine {
  display: grid;
  width: 37px;
  height: 37px;
  margin: 0 0 3px;
  place-items: center;
  border-radius: 12px;
  background: #e7f1e6;
  color: #43864a;
  font-size: 19px;
  line-height: 1;
}

#appView #home .homeQuietIcon svg {
  width: 20px;
  height: 20px;
}

#appView #home .noJobsMachine b,
#appView #home .noJobsMachine > span {
  display: none;
}

#appView #home .noJobsState h3,
#appView #home .homeQuietState h3 {
  margin: 0;
  color: #10263a;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -.2px;
}

#appView #home .noJobsState p,
#appView #home .homeQuietState p {
  max-width: 275px;
  margin: 0;
  color: #718077;
  font-size: 10px;
  line-height: 1.45;
}

#appView #home .homeQuietAction {
  margin-top: 3px;
  padding: 4px 7px;
  border: 0;
  background: transparent;
  color: #408945;
  font-size: 10px;
  font-weight: 820;
}

#appView #home .homeRecentHeader {
  align-items: center;
  margin: 0 0 11px;
}

#appView #home .homeRecentHeader h2 {
  margin: 5px 0 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.5px;
}

#appView #home .homeSeeAll {
  font-size: 10px;
}

#appView #home #homeScope .involvementScope {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 10px;
  padding: 7px 9px 7px 11px;
  border: 1px solid #e4ebe5;
  border-radius: 13px;
  background: #fff;
}

#appView #home #homeScope .scopeLabel {
  color: #627168;
  font-size: 10px;
  font-weight: 750;
}

#appView #home #homeScope .scopeSwitch {
  flex: 0 0 auto;
}

#appView #home #recent {
  gap: 8px;
}

#appView #home #recent .invoiceCard {
  min-height: 66px;
  padding: 12px 13px;
  border: 1px solid #e5ebe6;
  border-radius: 15px;
  background: #fff;
}

#appView #home #recent .invoiceCard strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appView #home #recent .invoiceCard > div:first-child {
  min-width: 0;
}

#appView #home #recent .invoiceCard span {
  font-size: 9px;
}

#appView #home #recent .empty {
  padding: 21px 15px;
  border-color: #dfe7e0;
  border-radius: 15px;
  font-size: 11px;
}

@media (min-width: 720px) {
  #appView #home .homeRoutePanel:not(.is-empty) .homeRouteBody {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    align-items: start;
    gap: 15px;
  }

  #appView #home .homeRoutePanel:not(.is-empty) .homeRouteCanvas {
    position: sticky;
    top: 104px;
    height: 255px;
  }
}

@media (max-width: 520px) {
  #appView #home .homePageHeader {
    gap: 10px;
    margin-bottom: 17px;
  }

  #appView #home .homeTitleCopy h1 {
    font-size: 31px;
  }

  #appView #home .homeDateBadge {
    padding: 8px 9px;
    font-size: 9px;
  }

  #appView #home .homeCommandDeck {
    padding: 20px 17px 17px;
    border-radius: 20px;
  }

  #appView #home #heroGreeting {
    font-size: clamp(23px, 6vw, 29px);
  }

  #appView #home .homeDayStatus {
    min-height: 28px;
    padding-inline: 7px;
    font-size: 8px;
  }

  #appView #home .homeHeroActions {
    margin-top: 16px;
  }

  #appView #home .homeMetrics {
    gap: 7px;
  }

  #appView #home .homeMetric {
    gap: 7px;
    min-height: 102px;
    padding: 11px 9px;
    border-radius: 15px;
  }

  #appView #home .homeMetric b {
    font-size: clamp(17px, 5.1vw, 23px);
  }

  #appView #home .homeMetric > span:last-child {
    font-size: 8px;
  }

  #appView #home .homeRoutePanel {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 18px;
  }

  #appView #home .homeRouteHead {
    gap: 8px;
    margin-bottom: 12px;
  }

  #appView #home .homeRoutePanel.is-empty .homeRouteCanvas {
    min-height: 138px;
    max-height: 160px;
  }

  #appView #home .homeRouteCanvas {
    height: 186px;
  }
}

@media (max-width: 370px) {
  #appView #home .homeTitleCopy > p {
    max-width: 190px;
  }

  #appView #home .homeDayStatus {
    font-size: 0;
  }

  #appView #home .homeDayStatus > i {
    width: 8px;
    height: 8px;
  }

  #appView #home .routeRowActions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #appView #home .homeHeroSchedule {
    transition: none;
  }
}
