.page.is-map {
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: calc(100vh - var(--header-h));
}

.page.is-map .page__top {
  display: none;
}

.page.is-map .page-body {
  flex: 1;
  margin: 0;
  min-height: 0;
  overflow: hidden;
}

.map-shell {
  display: flex;
  height: 100%;
  min-height: calc(100vh - var(--header-h));
  background: var(--white);
  position: relative;
}

.map-panel {
  flex: 0 0 468px;
  width: 468px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hairline);
  background: var(--white);
  min-height: 0;
  transition: margin-left 0.2s ease, opacity 0.2s ease;
}

.map-shell.is-panel-collapsed .map-panel {
  margin-left: -468px;
  opacity: 0;
  pointer-events: none;
}

.map-panel.map-panel--vehicle-detail {
  flex: 0 0 500px;
  width: 500px;
}

.map-shell.is-panel-collapsed .map-panel.map-panel--vehicle-detail {
  margin-left: -500px;
}

.map-shell:has(.map-panel--vehicle-detail) .map-panel-toggle {
  left: 500px;
}

.map-panel.map-panel--geofence {
  flex: 0 0 500px;
  width: 500px;
  background: var(--page);
}

.map-shell.is-panel-collapsed .map-panel.map-panel--geofence {
  margin-left: -500px;
}

.map-shell:has(.map-panel--geofence) .map-panel-toggle {
  left: 500px;
}

.map-panel__head {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

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

.map-tabs {
  display: flex;
  gap: 40px;
  border-bottom: none;
}

.map-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  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);
}

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

.map-tab img {
  width: 16px;
  height: 16px;
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
}

.map-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
}

.map-search.is-disabled {
  opacity: 0.5;
}

.map-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
}

.map-search input:disabled {
  cursor: default;
}

.map-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 16px;
  color: var(--muted);
  white-space: nowrap;
}

.map-filter-btn .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
}

.map-summary-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.map-summary-note {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}

.map-summary__sep {
  width: 1px;
  height: 16px;
  background: var(--hairline);
}

.map-summary__filters {
  font-weight: 400;
  font-size: 14px;
}

.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #f0f6ff;
  font-size: 14px;
  font-weight: 400;
}

.map-chip img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.map-geofence-count {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.map-create {
  display: inline-flex;
  gap: 4px;
  min-width: 0;
  height: 48px;
  padding: 16px 24px;
  font-size: 16px;
}

.map-create img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.map-panel__list {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.map-list-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 16px 12px;
  border-top: 1px solid var(--hairline);
  cursor: pointer;
}

.map-list-item.is-selected {
  background: #f0f6ff;
}

.map-list-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.map-list-item__thumb {
  width: 80px;
  height: 49px;
  object-fit: contain;
  flex-shrink: 0;
}

.map-list-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
}

.map-list-item__main {
  flex: 1;
  min-width: 0;
}

.map-list-item__name {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.map-list-item__sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-list-item__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.map-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}

.map-meta img {
  width: 16px;
  height: 16px;
}

.map-geofence-item {
  padding: 16px;
  border-top: 1px solid var(--hairline);
  cursor: pointer;
}

.map-geofence-item:hover,
.map-geofence-item:focus-visible {
  background: #f0f6ff;
  outline: none;
}

.map-geofence-item__name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.map-geofence-item__meta {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}

.map-geofence-item__meta span + span {
  padding-left: 8px;
  border-left: 1px solid var(--hairline);
}

/* Create geofence panel */
.map-gc {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.map-gc__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 0;
}

.map-gc__title {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}

.map-gc__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}

.map-gc__card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--white);
}

.map-gc__card-title {
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
}

.map-gc .dd-form-field.is-invalid {
  border-color: #d92d20;
}

.map-gc__shapes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 8px 12px;
}

.map-gc__shape-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 32px;
}

.map-gc-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.map-gc-radio__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.map-gc-radio__dot {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--input);
}

.map-gc-radio.is-checked .map-gc-radio__dot {
  border: none;
  background: center / contain no-repeat url("./assets/plans/radio-checked.svg");
}

.map-gc-radio:has(.map-gc-radio__input:focus-visible) .map-gc-radio__dot {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.map-gc__radius {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.map-gc__radius.is-disabled {
  opacity: 0.5;
}

.map-gc__radius-field {
  width: 60px;
  min-height: 40px;
  padding: 8px 12px;
}

.map-gc__radius-unit {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.map-gc__foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.map-gd__summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.map-gd__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.map-gd__meta span + span {
  padding-left: 12px;
  border-left: 1px solid var(--hairline);
}

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

.map-gd__action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--brand);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.map-gd__action--danger {
  color: #cc0300;
}

.map-gd__action-rule {
  align-self: stretch;
  width: 1px;
  background: var(--hairline);
}

.map-gd__rules-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.map-gd__rules-title {
  padding-bottom: 0;
  border-bottom: none;
}

.map-gd__notify {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
}

.map-gd__switch {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--grey-200);
  appearance: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.map-gd__switch::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 12px rgba(29, 42, 52, 0.06);
  transition: transform 0.15s ease;
}

.map-gd__switch:checked {
  background: var(--brand);
}

.map-gd__switch:checked::after {
  transform: translateX(16px);
}

.map-gd__switch:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.map-gd__empty {
  margin: 0;
  padding: 40px 0;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

.map-gd__rules {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.map-gd__rule {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
}

.map-gd__rule:first-child {
  padding-top: 0;
}

.map-gd__rule:last-child {
  padding-bottom: 0;
}

.map-gd__rule + .map-gd__rule {
  border-top: 1px solid var(--hairline);
}

.map-gd__rule-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-gd__rule-name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.map-gd__rule-more {
  display: inline-flex;
  flex-shrink: 0;
  padding: 4px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.map-gd__rule-more:hover,
.map-gd__rule-more.is-active {
  background: var(--brand-100);
}

.map-gd__rule-menu {
  position: fixed;
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--white);
  box-shadow: 0 4px 12px var(--hairline);
}

.map-gd__rule-menu button {
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.map-gd__rule-menu button:last-child {
  border-bottom: none;
}

.map-gd__rule-menu button:hover,
.map-gd__rule-menu button:focus-visible {
  background: var(--brand-100);
  color: var(--brand);
  outline: none;
}

.modal--rule-notifications {
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
}

.modal--confirm {
  width: min(450px, 100%);
}

.gr-confirm__text {
  margin: 0;
  padding: 16px 20px;
  font-size: 16px;
  line-height: 1.5;
}

.gr-head--divided {
  border-bottom: 1px solid var(--hairline);
}

.gr-foot--divided {
  border-top: 1px solid var(--hairline);
}

.gr-notify {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--page);
}

.gr-notify__card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  background: var(--white);
}

.gr-notify__card--delivery.is-disabled .gr-notify__group {
  opacity: 0.5;
}

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

.gr-notify__heading {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.gr-notify__group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gr-notify__group--email {
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.gr-notify__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
}

.gr-notify__row--sub {
  min-height: 0;
  font-size: 14px;
  line-height: 1.6;
}

.gr-notify__frequency {
  width: 250px;
}

.gr-notify__frequency .gr-select:disabled {
  opacity: 0.6;
}

.map-gd__switch:disabled {
  cursor: default;
}

.map-gd__rule-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Assign rules modal */
.modal--geofence-rules {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
}

.gr-head {
  padding: 20px;
}

.gr-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px;
}

.gr-intro {
  margin: 0;
  padding: 4px 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.modal--geofence-rules .gr-body:not(.gr-body--form) {
  flex: 1;
  min-height: 0;
}

.gr-table-card {
  display: flex;
  flex-direction: column;
  flex: 0 1 333px;
  min-height: 160px;
  margin-bottom: 8px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}

.gr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
}

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

.gr-toolbar__actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.gr-search {
  width: 250px;
  min-height: 48px;
}

.gr-toolbar__rule {
  width: 1px;
  background: var(--hairline);
}

.gr-add {
  gap: 8px;
  min-width: 108px;
  padding: 0 20px;
}

.gr-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.gr-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
  line-height: 1.6;
}

.gr-table th {
  height: 48px;
  padding: 12px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--grey-200);
  font-weight: 500;
  text-align: left;
}

.gr-table td {
  padding: 12px;
  border-bottom: 1px solid var(--hairline);
}

.gr-table th + th,
.gr-table td + td {
  border-left: 1px solid var(--hairline);
}

.gr-table .gr-table__check {
  padding: 16px 12px;
  line-height: 0;
}

.gr-table__name {
  font-weight: 500;
}

.gr-table__row.is-selected {
  background: var(--brand-100);
}

.gr-table__edit {
  text-align: center;
}

.gr-table .gr-table__empty {
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
}

.gr-icon-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.gr-icon-btn:disabled {
  cursor: default;
}

.gr-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 48px;
  padding: 16px 20px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  line-height: 1.4;
}

.gr-pagination__nav {
  display: flex;
  gap: 15px;
}

.gr-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 20px;
}

.gr-foot__count {
  min-width: 108px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.gr-assign {
  height: auto;
  padding: 12px 20px;
}

.gr-assign:disabled {
  border-color: transparent;
  background: var(--grey-200);
  color: #b0b9c4;
  opacity: 1;
}

.gr-head--back {
  justify-content: flex-start;
}

.gr-banner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand-100);
  font-size: 14px;
  line-height: 1.6;
}

.gr-banner img {
  flex-shrink: 0;
}

.gr-foot--split {
  justify-content: space-between;
}

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

.gr-cancel.gr-delete {
  color: #cc0300;
}

.gr-cancel.gr-delete:disabled {
  color: #b0b9c4;
}

.gr-body--form {
  gap: 16px;
  padding-bottom: 16px;
}

.gr-body--form .dd-form-field.is-invalid {
  border-color: #d92d20;
}

.gr-dropdown {
  position: relative;
}

.gr-select {
  width: 100%;
  height: 48px;
  padding-right: 36px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gr-select.dd-form-field--float {
  padding-top: 4px;
  padding-bottom: 4px;
}

.gr-select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.gr-select:disabled {
  cursor: default;
}

.gr-select__placeholder,
.gr-select__value {
  font-size: 14px;
  line-height: 1.6;
}

.gr-select__placeholder {
  color: var(--muted);
}

.gr-select__value {
  color: var(--ink);
}

.gr-select__chevron {
  transition: transform 0.15s ease;
}

.gr-dropdown.is-open .gr-select__chevron {
  transform: translateY(-50%) rotate(180deg);
}

.gr-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 5;
  width: 100%;
  max-height: 240px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 1px 12px rgba(29, 42, 52, 0.06);
}

.gr-menu__item {
  position: relative;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}

.gr-menu__item + .gr-menu__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  border-top: 1px solid var(--hairline);
}

.gr-menu__item:hover,
.gr-menu__item:focus-visible {
  background: var(--brand-100);
}

.gr-menu__item.is-selected {
  font-weight: 500;
}

.gr-triggers {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 40px;
  padding: 0 16px;
}

.gr-trigger__text {
  font-size: 16px;
  line-height: 1.5;
}

.gr-error {
  margin-top: -12px;
  padding: 0 16px;
}

.gr-cancel {
  min-width: 108px;
  height: auto;
  padding: 12px 20px;
}

.gr-cancel:disabled {
  color: #b0b9c4;
}

.gr-save.is-saving,
.gr-save.is-saving:disabled {
  height: 48px;
  padding: 0 20px;
  border-color: var(--hairline);
  background: #0b598e;
  opacity: 1;
}

.gr-save__spinner {
  margin: 0 4px;
  animation: gr-spin 0.9s linear infinite;
}

@keyframes gr-spin {
  to {
    transform: rotate(360deg);
  }
}

.map-gc-shape--static .map-gc-handle {
  pointer-events: none;
}

.map-stage--geofence-create .map-stage__base {
  object-position: 15% center;
}

.map-gc-circle {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  border: 2px solid var(--brand);
  border-radius: 50%;
  background: rgba(122, 186, 242, 0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-gc-handle--resize {
  cursor: nwse-resize;
}

.map-gc-shape {
  position: absolute;
  left: 52%;
  top: 45%;
  width: 0;
  height: 0;
}

.map-gc-shape__svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

.map-gc-shape__svg polygon {
  fill: rgba(122, 186, 242, 0.2);
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linejoin: round;
}

.map-gc-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  background: var(--white);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
}

.map-gc-handle--mid {
  width: 10px;
  height: 10px;
  opacity: 0.6;
  cursor: copy;
}

.map-gc-handle--mid:hover {
  opacity: 1;
}

.map-stage.is-shape-dragging,
.map-stage.is-shape-dragging .map-gc-handle {
  cursor: grabbing;
  user-select: none;
}

/* Map asset detail panel (vehicle selected) */
.map-vd-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.map-vd-head {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 0;
}

.map-vd-head__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.map-vd-head__title {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}

.map-vd-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.map-vd-close img {
  width: 24px;
  height: 24px;
}

.map-vd-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--hairline);
}

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

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

.map-vd-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.map-vd-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-vd-stack .vd-card {
  margin: 0;
}

.map-panel--trips .map-vd-scroll {
  padding: 0;
}

.map-vd-trips {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.map-vd-trips .vd-trips__history {
  flex: 1;
  min-height: 0;
  border-radius: 0;
}

.map-vd-trips--detail,
.map-vd-trips--detail .vd-trips__detail {
  flex: 1;
  min-height: 0;
  height: 100%;
  border-radius: 0;
}

.map-vd-trips--empty {
  padding: 8px 16px 16px;
}

.map-vd-trips--empty .vd-trips-unavailable {
  padding: 16px 0;
}

.map-stage--trips {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #e8edf2;
}

.map-stage--trips .vd-trips__map-stage {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 0;
}

.map-stage--trips .vd-trips__map-base {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-stage--trips .vd-trips__controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
}

.map-stage--trips .vd-trips__map-edge {
  display: none;
}

.map-panel-toggle {
  position: absolute;
  left: 468px;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 20px;
  height: 50px;
  padding: 0;
  border: none;
  border-radius: 0 12px 12px 0;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--hairline);
  transform: translateY(-50%);
  transition: left 0.2s ease;
}

.map-shell.is-panel-collapsed .map-panel-toggle {
  left: 0;
}

.map-shell.is-panel-collapsed .map-panel-toggle img {
  transform: rotate(180deg);
}

.map-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: #e8eaed;
}

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

.map-stage--vehicles .map-stage__base {
  object-position: 35% center;
}

.map-stage--geofences .map-stage__base {
  object-position: center;
}

.map-stage__zone {
  position: absolute;
  left: 8%;
  top: 28%;
  width: 52%;
  pointer-events: none;
}

.map-ov-shape {
  position: absolute;
  width: 0;
  height: 0;
}

.map-ov-shape.is-active,
.map-ov-shape:hover {
  z-index: 2;
}

.map-ov-circle {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  border: 1.5px solid #0c1114;
  border-radius: 50%;
  background: rgba(12, 17, 20, 0.12);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.map-ov-svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

.map-ov-svg polygon {
  fill: rgba(12, 17, 20, 0.12);
  stroke: #0c1114;
  stroke-width: 1.5;
  stroke-linejoin: round;
  pointer-events: visiblePainted;
  cursor: pointer;
}

.map-ov-shape.is-active .map-ov-circle,
.map-ov-shape:hover .map-ov-circle {
  border-color: var(--brand);
  background: rgba(122, 186, 242, 0.35);
}

.map-ov-shape.is-active .map-ov-svg polygon,
.map-ov-shape:hover .map-ov-svg polygon {
  fill: rgba(122, 186, 242, 0.35);
  stroke: var(--brand);
}

.map-tooltip.map-ov-tooltip {
  left: 0;
  display: none;
  transform: translate(-50%, -100%);
}

.map-ov-shape.is-active .map-ov-tooltip,
.map-ov-shape:hover .map-ov-tooltip {
  display: flex;
}

.map-pin-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: #33404c;
  box-shadow: 0 4px 6px var(--hairline);
}

.map-pin[data-map-vehicle-id] {
  pointer-events: auto;
  cursor: pointer;
}

.map-pin.is-selected {
  background: var(--brand);
  border-color: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.35);
}

.map-pin img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.map-pin--depot {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  padding: 8px;
  background: var(--brand);
}

.map-pin--depot img {
  filter: brightness(0) invert(1);
}

.map-cluster {
  position: absolute;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
}

.map-cluster__halo,
.map-cluster__ring,
.map-cluster__core {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
}

.map-cluster__halo {
  inset: -5px;
  background: rgba(153, 153, 153, 0.3);
}

.map-cluster__ring {
  inset: 0;
  border: 1px solid #1b232a;
}

.map-cluster__core {
  inset: 3px;
  background: #33404c;
}

.map-layers {
  position: absolute;
  top: 13px;
  right: 64px;
  width: 176px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 4px 6px var(--hairline);
  overflow: hidden;
}

.map-layer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--hairline);
  font-size: 16px;
}

.map-layer:last-child {
  border-bottom: none;
}

.map-controls {
  position: absolute;
  right: 16px;
  top: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 40px;
  pointer-events: none;
}

.map-controls__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
}

.map-control-btn img {
  width: 20px;
  height: 20px;
}

.map-tooltip {
  position: absolute;
  left: 14%;
  top: 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 4px 6px var(--hairline));
  pointer-events: none;
}

.map-tooltip p {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--white);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.map-tooltip img {
  width: 15px;
  height: 10px;
  margin-top: -1px;
}
