:root {
  --bg: #f4fbff;
  --panel: #ffffff;
  --ink: #0f2538;
  --muted: #4f667a;
  --line: #d6e7f2;
  --azure: #0f9ad6;
  --azure-strong: #046d99;
  --teal: #0ba78f;
  --amber: #de8f12;
  --danger: #c73f3f;
  --indigo: #3550c9;
  --chip: #eaf6ff;
  --ok: #157f5f;
  --warn: #a56a09;
  --shadow: 0 16px 40px rgba(6, 66, 96, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: linear-gradient(140deg, #f7fcff 0%, #e8f5ff 42%, #f8fff8 100%);
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  z-index: -3;
}

.orb-a {
  width: 40vw;
  height: 40vw;
  min-width: 280px;
  min-height: 280px;
  top: -16vw;
  right: -10vw;
  background: radial-gradient(circle, rgba(15, 154, 214, 0.28) 0%, rgba(15, 154, 214, 0) 70%);
}

.orb-b {
  width: 36vw;
  height: 36vw;
  min-width: 260px;
  min-height: 260px;
  bottom: -16vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(11, 167, 143, 0.22) 0%, rgba(11, 167, 143, 0) 70%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(60, 99, 122, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 99, 122, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
}

.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  animation: rise-in 500ms ease both;
}

.card:nth-child(2) {
  animation-delay: 80ms;
}

.card:nth-child(3) {
  animation-delay: 120ms;
}

.card:nth-child(4) {
  animation-delay: 160ms;
}

.card:nth-child(5) {
  animation-delay: 200ms;
}

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

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  font-size: 12px;
  color: var(--azure-strong);
  margin: 0 0 6px;
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(24px, 3.2vw, 38px);
}

h2 {
  font-size: clamp(18px, 2.4vw, 24px);
}

.hero-text {
  color: var(--muted);
  max-width: 760px;
  margin: 10px 0 0;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
  min-width: min(420px, 42vw);
}

.stat-pill {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}

.stat-pill .label {
  font-size: 12px;
  color: var(--muted);
}

.stat-pill .value {
  font-weight: 800;
  font-family: "Space Grotesk", sans-serif;
}

.value.ok {
  color: var(--ok);
}

.value.warn {
  color: var(--warn);
}

.value.err {
  color: var(--danger);
}

.layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

.map-card {
  grid-column: 1 / -1;
}

.destinations-card {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-actions {
  display: flex;
  gap: 8px;
}

.inline-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid #cce3f2;
  background: var(--chip);
  color: #184c68;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

#mapCanvas {
  width: 100%;
  height: clamp(360px, 52vh, 620px);
  border-radius: 14px;
  border: 1px solid #c7deec;
  overflow: hidden;
}

.ship-marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: radial-gradient(circle at 35% 35%, #11b6ef 0%, #08658b 90%);
  border: 2px solid #ffffff;
  box-shadow: 0 6px 18px rgba(8, 101, 139, 0.35);
  font-size: 12px;
  font-weight: 800;
}

.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  align-items: center;
}

.control-bar.compact {
  margin-top: 6px;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.input-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.progress-wrap {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: #d9ecf8;
  border: 1px solid #bddbed;
  overflow: hidden;
}

.progress-track.subtle {
  height: 8px;
}

.progress-track > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f9ad6 0%, #0ba78f 70%, #8fd8b9 100%);
  transition: width 180ms linear;
}

.progress-track.subtle > i {
  background: linear-gradient(90deg, #3550c9 0%, #0f9ad6 100%);
}

.preflight-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.preflight-list li {
  border-radius: 10px;
  border: 1px solid #d8ebf4;
  background: #f9fdff;
  padding: 8px 10px;
  font-size: 13px;
}

.preflight-list li.fail {
  border-color: #f3d3d3;
  background: #fff7f7;
  color: #8a2929;
}

.preflight-list li.ok {
  border-color: #cceedd;
  background: #f5fff9;
  color: #116548;
}

.status-grid {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-item {
  border: 1px solid #d5e8f2;
  border-radius: 999px;
  padding: 6px 11px;
  background: #f5fbff;
  font-size: 12px;
}

.status-item.ok {
  border-color: #bde8d6;
  color: #116548;
  background: #f4fff9;
}

.status-item.err {
  border-color: #f2cfd1;
  color: #892b35;
  background: #fff7f8;
}

.status-item.off {
  border-color: #e4e4e4;
  color: #6b6b6b;
  background: #fafafa;
}

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

.voyage-grid {
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
}

label {
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 6px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid #c5ddeb;
  border-radius: 11px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: #0f9ad6;
  box-shadow: 0 0 0 3px rgba(15, 154, 214, 0.15);
}

.btn {
  border: 0;
  border-radius: 11px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.btn-azure {
  background: linear-gradient(135deg, #0f9ad6 0%, #0ba78f 100%);
  color: #ffffff;
}

.btn-indigo {
  background: linear-gradient(135deg, #2f47b8 0%, #4f69e6 100%);
  color: #ffffff;
}

.btn-outline {
  border: 1px solid #bdd8e8;
  background: #f8fcff;
  color: #225675;
}

.btn-start {
  background: linear-gradient(135deg, #0ba78f 0%, #20b78a 100%);
  color: #ffffff;
}

.btn-warn {
  background: linear-gradient(135deg, #d9931b 0%, #e1a13b 100%);
  color: #ffffff;
}

.btn-danger {
  background: linear-gradient(135deg, #c73f3f 0%, #de6058 100%);
  color: #ffffff;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #d7e8f2;
  padding: 9px 8px;
  font-size: 13px;
}

td .table-input {
  min-width: 120px;
}

td .table-select {
  min-width: 90px;
}

td .table-port {
  min-width: 80px;
}

td .row-remove {
  white-space: nowrap;
}

#eventLog {
  margin: 0;
  padding: 12px;
  min-height: 240px;
  max-height: 320px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid #c8deec;
  background: linear-gradient(180deg, #f8fcff 0%, #eef7ff 100%);
  color: #123f59;
  font-size: 12px;
  line-height: 1.55;
  font-family: "Space Grotesk", monospace;
}

@keyframes rise-in {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

  .hero-stats {
    min-width: 100%;
  }

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

@media (max-width: 720px) {
  .shell {
    padding: 14px 10px 30px;
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

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

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

  .control-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    width: 100%;
  }

  .control-group .btn,
  .control-group .input-inline {
    width: 100%;
  }

  .input-inline {
    display: grid;
  }
}
.btn-profile{background:linear-gradient(135deg,#225675 0%,#2b7a98 100%);color:#fff}
