* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #071013;
  color: #f7fbfb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#map {
  width: 100%;
  height: 100%;
  background: #071013;
}

.hidden {
  display: none !important;
}

.top-panel {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 360px) auto auto auto auto auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 14, 17, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-block img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
}

.account-name {
  overflow: hidden;
  max-width: 42vw;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-status {
  color: #9ee7d7;
  font-size: 13px;
  font-weight: 650;
}

.connection-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
}

.connection-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  background: #ef3340;
  box-shadow: 0 0 0 3px rgba(239, 51, 64, 0.18);
}

.connection-dot.is-connected {
  background: #00c853;
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.18), 0 0 12px rgba(0, 200, 83, 0.65);
}

.connection-dot.is-connecting {
  background: #ffd54f;
  box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.2);
}

.connection-dot.is-disconnected {
  background: #d50000;
  box-shadow: 0 0 0 3px rgba(213, 0, 0, 0.18);
}

.fleet-control {
  display: grid;
  gap: 4px;
}

.fleet-control label {
  color: #a8b7bb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fleet-control select {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  font-size: 15px;
  font-weight: 750;
  outline: none;
  padding: 0 12px;
}

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

.metric-strip div {
  min-width: 70px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
}

.metric-strip span {
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

.metric-strip small {
  color: #b9c7ca;
  font-size: 11px;
  font-weight: 750;
}

.icon-button,
.collapsed-toolbar {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  font-size: 26px;
  font-weight: 800;
}

.icon-button:hover,
.panel-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

.collapsed-toolbar {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 21;
  width: auto;
  min-width: 128px;
  padding: 9px 10px;
  gap: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5, 14, 17, 0.86);
  backdrop-filter: blur(12px);
}

.collapsed-toolbar img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.collapsed-expand-icon {
  color: #ffffff;
  font-size: 32px;
  font-weight: 850;
  line-height: 1;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(0deg, rgba(4, 17, 20, 0.8), rgba(4, 17, 20, 0.84)),
    url("/images/boatbg1.jpg") center / cover no-repeat;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 26px;
  background: rgba(5, 14, 17, 0.9);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.login-logo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
}

.login-card h1 {
  margin: 18px 0 6px;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.login-card p {
  margin: 0 0 22px;
  color: #b9c7ca;
  font-size: 14px;
  line-height: 1.5;
}

.login-card label {
  display: block;
  margin: 14px 0 6px;
  color: #d7e3e5;
  font-size: 13px;
  font-weight: 800;
}

.login-card input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 16px;
  outline: none;
  padding: 0 12px;
}

.login-card input:focus,
.fleet-control select:focus {
  border-color: #21c7a8;
  box-shadow: 0 0 0 3px rgba(33, 199, 168, 0.18);
}

.error-text {
  min-height: 20px;
  margin: 12px 0 10px;
  color: #ffb4ba;
  font-size: 13px;
  font-weight: 700;
}

.login-card button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: #21c7a8;
  color: #02201b;
  cursor: pointer;
  font-size: 16px;
  font-weight: 850;
}

.login-card button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.boat-side-label {
  position: absolute;
  max-width: 260px;
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  padding: 3px 8px;
  background: rgba(5, 14, 17, 0.72);
  color: #ffffff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  overflow: hidden;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
  text-overflow: ellipsis;
  transform: translateY(-50%);
  white-space: nowrap;
}

.boat-side-label.is-live {
  border-color: rgba(0, 200, 83, 0.72);
  background: rgba(0, 78, 33, 0.82);
  color: #bfffd5;
}

.boat-side-label.is-offline {
  border-color: rgba(213, 0, 0, 0.72);
  background: rgba(82, 0, 0, 0.84);
  color: #ffd0d0;
}

.map-info {
  display: grid;
  gap: 6px;
  min-width: 260px;
  color: #0b1518;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
}

.gm-style-iw-ch {
  min-height: 0 !important;
  padding-top: 8px !important;
}

.gm-style-iw-chr {
  align-items: center !important;
}

.gm-style-iw-chr .gm-style-iw-ch {
  color: #0b1518;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.map-info strong {
  margin-bottom: 2px;
  font-size: 14px;
}

.map-info div {
  display: grid;
  grid-template-columns: 92px 1fr;
  column-gap: 10px;
  align-items: start;
}

.map-info b,
.map-info span {
  font-size: 12px;
  line-height: 1.35;
}

.map-info b {
  font-weight: 800;
}

@media (max-width: 820px) {
  .top-panel {
    grid-template-columns: 1fr auto auto auto auto;
    align-items: stretch;
  }

  .brand-block,
  .fleet-control {
    grid-column: 1 / -1;
  }

  .metric-strip {
    grid-column: 1;
  }

  .account-name {
    max-width: 76vw;
  }
}

@media (max-width: 520px) {
  .top-panel {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 8px;
  }

  .metric-strip div {
    min-width: 58px;
  }

  .icon-button {
    width: 46px;
    height: 46px;
  }

  .login-card {
    padding: 20px;
  }
}
