@font-face {
  font-family: "Montserrat";
  src: url("./assets/fonts/Montserrat-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #e2e6eb;
  --surface: rgba(246, 249, 252, 0.44);
  --surface-strong: rgba(255, 255, 255, 0.68);
  --ink: #10141a;
  --muted: #4f5964;
  --line: rgba(255, 255, 255, 0.68);
  --line-strong: rgba(16, 20, 26, 0.12);
  --accent: #11151b;
  --accent-strong: #10141a;
  --navy: #001d52;
  --coral: #8b95a3;
  --coral-soft: rgba(255, 255, 255, 0.38);
  --soft-active: rgba(255, 255, 255, 0.42);
  --green: #4d735b;
  --green-soft: rgba(235, 245, 238, 0.58);
  --glass: linear-gradient(145deg, rgba(255, 255, 255, 0.54), rgba(242, 246, 250, 0.28));
  --glass-strong: linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(242, 246, 250, 0.38));
  --shadow: 0 18px 48px rgba(21, 29, 38, 0.1);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 25%),
    linear-gradient(135deg, #cbd5df 0%, #eef2f6 42%, #bdc9d6 100%);
  font-family: "Montserrat", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background:
    linear-gradient(106deg, transparent 0 9%, rgba(255, 255, 255, 0.74) 18%, rgba(255, 255, 255, 0.26) 30%, transparent 43%),
    linear-gradient(286deg, transparent 0 12%, rgba(127, 151, 177, 0.32) 29%, transparent 50%),
    conic-gradient(from 0.71turn at 10% 14%, transparent 0 10%, rgba(255, 255, 255, 0.96) 16% 29%, rgba(153, 176, 199, 0.66) 35% 48%, transparent 60% 100%),
    conic-gradient(from 0.17turn at 88% 14%, transparent 0 15%, rgba(135, 162, 190, 0.58) 23% 39%, rgba(255, 255, 255, 0.54) 46% 58%, transparent 69% 100%),
    conic-gradient(from 0.58turn at 51% 79%, transparent 0 13%, rgba(255, 255, 255, 0.84) 21% 39%, rgba(145, 170, 195, 0.42) 47% 63%, transparent 74% 100%);
  background-blend-mode: screen, multiply, screen, multiply, screen;
  filter: blur(18px) saturate(1.12);
  transform: scale(1.05);
}

body::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 360'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='360' height='360' filter='url(%23n)' opacity='.46'/%3E%3C/svg%3E");
  background-size: 460px 460px;
  opacity: 0.13;
  mix-blend-mode: soft-light;
}

#app {
  position: relative;
  z-index: 1;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.portal-layout {
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  min-height: 100vh;
}

.topbar {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-width: 0;
  padding: 0 14px;
  border-bottom: 1px solid rgba(17, 23, 31, 0.1);
  background: rgba(242, 246, 249, 0.34);
  backdrop-filter: blur(18px) saturate(115%);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px) saturate(112%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.topbar-brand img {
  width: 150px;
  height: auto;
  filter: grayscale(1) contrast(1.05);
}

.topbar-brand span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-metrics {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 4vw, 64px);
  min-width: 0;
}

.metric {
  display: grid;
  gap: 3px;
  min-width: 92px;
  text-align: center;
}

.metric strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.metric-actual strong {
  color: var(--accent-strong);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.round-action,
.user-chip {
  position: relative;
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.24);
  color: var(--muted);
  backdrop-filter: blur(18px) saturate(112%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.round-action {
  width: 34px;
  color: var(--ink);
}

.round-action.alert {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.38);
}

.round-action b {
  position: absolute;
  top: -7px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  border-radius: 99px;
  color: #fff;
  background: #d64033;
  font-size: 10px;
  line-height: 17px;
}

.round-action svg,
.user-chip svg {
  width: 17px;
  height: 17px;
}

.user-chip {
  grid-template-columns: 17px minmax(0, auto);
  gap: 8px;
  padding: 0 10px;
  max-width: 190px;
}

.user-chip span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-shell {
  display: grid;
  grid-template-columns: 76px 382px minmax(0, 1fr);
  min-height: 0;
  height: calc(100vh - 58px);
  overflow: hidden;
}

.primary-nav {
  position: sticky;
  top: 58px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  height: calc(100vh - 58px);
  padding: 14px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.54);
  background: rgba(246, 249, 252, 0.36);
  backdrop-filter: blur(24px) saturate(112%);
}

.nav-list {
  display: grid;
  gap: 5px;
  width: 100%;
}

.nav-button {
  position: relative;
  display: grid;
  width: 54px;
  height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #252a31;
  background: rgba(255, 255, 255, 0.12);
  transition: color 160ms ease, background 160ms ease, border 160ms ease;
}

.nav-button svg {
  width: 20px;
  height: 20px;
}

.nav-button:hover,
.nav-button.is-active {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.nav-button.is-active::before {
  position: absolute;
  left: -10px;
  width: 3px;
  height: 26px;
  border-radius: 99px;
  background: rgba(17, 21, 27, 0.82);
  content: "";
}

.nav-button-muted {
  margin-top: auto;
}

.nav-tooltip {
  position: absolute;
  left: 64px;
  z-index: 30;
  max-width: 220px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(248, 251, 253, 0.78);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.nav-button:hover .nav-tooltip,
.nav-button:focus-visible .nav-tooltip {
  opacity: 1;
  transform: translateX(0);
}

.context-panel {
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 58px);
  border-right: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(246, 249, 252, 0.34);
  backdrop-filter: blur(28px) saturate(112%);
  overflow: hidden;
}

.context-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.26);
}

.eyebrow {
  margin: 0 0 4px;
  color: #5f6974;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 760;
  letter-spacing: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.12;
}

h2 {
  font-size: 18px;
  line-height: 1.16;
}

.filter-stack {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.22);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px) saturate(112%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.segment {
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.segment.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 22px rgba(24, 30, 38, 0.06);
}

.input-shell,
.select-shell {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px) saturate(112%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.input-shell:focus-within,
.select-shell:focus-within {
  border-color: rgba(16, 20, 26, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 0 0 3px rgba(16, 20, 26, 0.06);
}

.input-shell svg,
.select-shell svg {
  width: 17px;
  height: 17px;
  color: var(--ink);
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

input::placeholder {
  color: #8e8e85;
}

.request-summary {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.22);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.summary-head span {
  font-size: 14px;
  font-weight: 800;
}

.summary-head b {
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.request-summary dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.request-summary div {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 10px;
}

.request-summary dt,
.request-summary dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
}

.request-summary dt {
  color: var(--muted);
  font-weight: 750;
}

.request-summary dd {
  font-weight: 700;
}

.route-warning {
  margin: 14px 18px 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  color: #5a463a;
  background: rgba(255, 250, 243, 0.42);
  backdrop-filter: blur(18px) saturate(112%);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.panel-list {
  display: grid;
  align-content: start;
  gap: 9px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 18px 24px;
  overflow: auto;
}

.compact-list {
  gap: 8px;
}

.entity-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  color: var(--ink);
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(112%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 16px 44px rgba(27, 34, 43, 0.08);
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.entity-card:hover {
  border-color: rgba(16, 20, 26, 0.12);
  background: var(--glass-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 22px 54px rgba(27, 34, 43, 0.13);
  transform: translateY(-1px);
}

.entity-card strong {
  font-size: 17px;
  font-weight: 820;
  line-height: 1.08;
}

.entity-card span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.card-kicker {
  color: #11151b !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  text-transform: uppercase;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.card-meta span {
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.44);
  font-size: 11px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  height: calc(100vh - 58px);
  overflow: hidden;
}

.workspace-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  min-height: 84px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(246, 249, 252, 0.34);
  backdrop-filter: blur(24px) saturate(112%);
}

.route-controls {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(160px, 240px) 42px 42px minmax(118px, auto);
  gap: 8px;
  min-width: 0;
  align-items: center;
}

.select-shell {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.24);
}

.icon-command,
.text-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px) saturate(112%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.icon-command {
  width: 42px;
  height: 42px;
}

.icon-command:hover,
.text-command:hover {
  border-color: rgba(16, 20, 26, 0.16);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
}

.icon-command.is-active {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.52);
}

.icon-command svg,
.text-command svg {
  width: 18px;
  height: 18px;
}

.text-command {
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 750;
}

.route-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px) saturate(112%);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.route-status[data-status="loading"] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
}

.route-status[data-status="success"] {
  color: #365642;
  background: var(--green-soft);
}

.map-shell {
  position: relative;
  min-height: 0;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(135deg, #cbd5df 0%, #eef2f6 42%, #bdc9d6 100%);
  background-size: 48px 48px;
}

.map-fallback svg {
  width: 48px;
  height: 48px;
  color: var(--ink);
}

.map-fallback strong {
  font-size: 16px;
  font-weight: 800;
}

.table-shell {
  min-height: 0;
  background: rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(24px) saturate(112%);
  overflow: auto;
}

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

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  font-size: 13px;
  font-weight: 650;
}

.status-pill {
  display: inline-flex;
  padding: 6px 8px;
  border-radius: 6px;
  color: #365642;
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  display: grid;
  min-height: 96px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px) saturate(112%);
  font-size: 13px;
  font-weight: 650;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 250px minmax(0, 1fr) auto;
  }

  .topbar-metrics {
    justify-content: start;
    overflow: auto;
  }

  .portal-shell {
    grid-template-columns: 72px 340px minmax(0, 1fr);
  }

  .workspace-toolbar {
    grid-template-columns: 1fr;
  }

  .route-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 42px 42px minmax(118px, auto);
    width: 100%;
  }
}

@media (max-width: 860px) {
  .portal-layout {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 58px;
  }

  .topbar-metrics {
    grid-column: 1 / -1;
    justify-content: stretch;
    padding-bottom: 10px;
  }

  .portal-shell {
    grid-template-columns: 62px minmax(0, 1fr);
    grid-template-rows: auto minmax(560px, 1fr);
    height: auto;
    min-height: calc(100vh - 102px);
    overflow: auto;
  }

  .primary-nav {
    top: 0;
    grid-row: 1 / 3;
    height: 100%;
  }

  .context-panel,
  .workspace {
    height: auto;
  }

  .workspace {
    grid-column: 2;
    min-height: 580px;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 10px;
    padding: 8px;
  }

  .topbar-brand img {
    width: 118px;
  }

  .topbar-brand span,
  .user-chip span,
  .metric span {
    display: none;
  }

  .topbar-metrics {
    gap: 10px;
  }

  .metric {
    min-width: auto;
  }

  .metric strong {
    font-size: 13px;
  }

  .portal-shell {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .primary-nav {
    width: 54px;
    padding-inline: 6px;
  }

  .nav-button {
    width: 42px;
    height: 42px;
  }

  .context-heading,
  .filter-stack,
  .request-summary,
  .panel-list,
  .workspace-toolbar {
    padding-inline: 12px;
  }

  .route-warning {
    margin-inline: 12px;
  }

  .route-controls {
    grid-template-columns: 1fr;
  }

  .icon-command {
    width: 100%;
  }
}
