:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(12, 26, 43, 0.78);
  --panel-strong: rgba(17, 34, 55, 0.94);
  --line: rgba(136, 165, 196, 0.22);
  --text: #eff6ff;
  --muted: #8fa5bd;
  --ryanair-blue: #073590;
  --blue: #1f8fff;
  --cyan: #45f1ff;
  --yellow: #f1c933;
  --green: #3be38b;
  --red: #ff526f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(241, 201, 51, 0.14), transparent 24rem),
    radial-gradient(circle at 82% 0%, rgba(31, 143, 255, 0.2), transparent 28rem),
    linear-gradient(135deg, #06102a 0%, #081b3f 48%, #050d1b 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell > * {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(4, 13, 25, 0.72);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(241, 201, 51, 0.7);
  background: linear-gradient(135deg, #073590, #0f52bd 58%, rgba(241, 201, 51, 0.52));
  border-radius: 8px;
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--text);
  background: rgba(33, 168, 255, 0.13);
}

.ops-status {
  position: absolute;
  right: 18px;
  bottom: 24px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(59, 227, 139, 0.24);
  border-radius: 8px;
  background: rgba(59, 227, 139, 0.08);
  color: #c7f8dd;
  font-size: 13px;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(59, 227, 139, 0.62);
  animation: pulse 1.7s infinite;
}

main {
  min-width: 0;
  padding: 24px;
  overflow: hidden;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.topbar-actions,
.panel-header,
.segmented,
.map-legend,
.slider-label {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.primary-button,
.secondary-button,
.icon-button,
.segmented button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}

.primary-button {
  padding: 0 14px;
  border-color: rgba(241, 201, 51, 0.55);
  background: linear-gradient(135deg, #073590, #1172dc);
  box-shadow: 0 10px 28px rgba(7, 53, 144, 0.32);
  font-weight: 700;
}

.secondary-button {
  padding: 0 14px;
  background: rgba(241, 201, 51, 0.12);
  color: #fff6bf;
}

.icon-button {
  display: grid;
  width: 40px;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
}

.ticker-strip {
  position: relative;
  overflow: hidden;
  height: 42px;
  border: 1px solid rgba(255, 216, 74, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 30px rgba(255, 216, 74, 0.05);
}

.ticker-track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: max-content;
  animation: ticker 28s linear infinite;
}

.ticker-strip:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 230px;
  padding: 12px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  white-space: nowrap;
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.ticker-item:hover {
  background: rgba(241, 201, 51, 0.08);
}

.up {
  color: var(--green);
}

.down {
  color: var(--red);
}

.pending {
  color: var(--yellow);
}

.pricing-table span.up,
.pricing-table span.down,
.pricing-table span.pending {
  color: currentColor;
}

.pricing-table span.up {
  color: var(--green);
}

.pricing-table span.down {
  color: var(--red);
}

.pricing-table span.pending {
  color: var(--yellow);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.kpi-grid article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.kpi-grid article {
  padding: 16px;
}

.kpi-grid span,
.pricing-table span,
.simulation-output span,
.competitors span {
  color: var(--muted);
  font-size: 12px;
}

.kpi-grid strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 25px;
}

.kpi-grid em {
  font-style: normal;
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.main-column,
.side-column {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 16px;
}

.panel-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.segmented {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.segmented button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.segmented button.selected {
  background: rgba(33, 168, 255, 0.2);
  color: var(--text);
}

.pricing-table {
  overflow: hidden;
  border: 1px solid rgba(136, 165, 196, 0.14);
  border-radius: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.25fr 0.7fr 0.7fr 0.7fr 0.9fr 0.8fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-bottom: 1px solid rgba(136, 165, 196, 0.12);
  background: transparent;
  color: var(--text);
  text-align: left;
}

button.table-row:hover,
.table-row.selected-row {
  background: rgba(31, 143, 255, 0.1);
}

.table-row.selected-row {
  box-shadow: inset 3px 0 0 var(--yellow);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.05);
  text-transform: uppercase;
}

.route-code {
  display: grid;
  gap: 2px;
}

.route-code strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
}

.ai-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 216, 74, 0.1);
  color: var(--yellow);
  font-size: 12px;
}

.ai-pill.approved {
  background: rgba(59, 227, 139, 0.12);
  color: var(--green);
}

.route-map {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  border: 1px solid rgba(136, 165, 196, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    rgba(3, 12, 23, 0.78);
  background-size: 34px 34px;
}

.route-map svg {
  width: 100%;
  height: 330px;
}

.land {
  fill: rgba(62, 88, 116, 0.32);
  stroke: rgba(143, 165, 189, 0.24);
}

.route {
  fill: none;
  stroke-width: 3;
  stroke-dasharray: 8 10;
  filter: url("#glow");
  animation: dash 4s linear infinite;
}

.route-click {
  cursor: pointer;
}

.route-click:hover {
  stroke-width: 5;
}

.route.profitable {
  stroke: var(--green);
}

.route.volatile {
  stroke: var(--yellow);
}

.route.under {
  stroke: var(--red);
}

.city circle {
  fill: #07111f;
  stroke: var(--cyan);
  stroke-width: 3;
}

.city text {
  fill: var(--text);
  font: 700 13px "SFMono-Regular", Consolas, monospace;
}

.map-legend {
  position: absolute;
  right: 14px;
  bottom: 12px;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 12, 23, 0.74);
  color: var(--muted);
  font-size: 12px;
}

.map-legend b {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}

.green {
  background: var(--green);
}

.yellow {
  background: var(--yellow);
}

.red {
  background: var(--red);
}

.timestamp {
  color: var(--muted);
  font-size: 12px;
}

.passenger-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
}

.persona,
.trip-pack {
  border: 1px solid rgba(136, 165, 196, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
}

.persona {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
}

.avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 216, 74, 0.95), rgba(33, 168, 255, 0.85));
  color: #06101d;
  font-weight: 800;
}

.persona p {
  color: var(--muted);
  font-size: 13px;
}

dl {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 0;
}

dt,
dd {
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 11px;
}

dd {
  margin-top: 4px;
  font-weight: 800;
}

.trip-pack ul,
.signals {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 10px 0 14px;
  list-style: none;
}

.trip-pack li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dcecff;
  font-size: 14px;
}

.trip-pack li span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: rgba(59, 227, 139, 0.14);
  color: var(--green);
  font-weight: 800;
}

.loyalty-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.loyalty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.loyalty-row strong {
  color: var(--text);
}

.progress-track {
  overflow: hidden;
  height: 12px;
  margin: 12px 0;
  border: 1px solid rgba(241, 201, 51, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--green));
  transition: width 260ms ease;
}

#rewardText {
  color: #d9e9fb;
  font-size: 13px;
}

.timeline {
  border: 1px solid rgba(136, 165, 196, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.timeline ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 10px 0 0;
  list-style: none;
}

.timeline li {
  color: var(--muted);
  font-size: 13px;
}

.recommendation-list {
  display: grid;
  gap: 10px;
}

.recommendation-card {
  border: 1px solid rgba(136, 165, 196, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.recommendation-card:hover {
  border-color: rgba(241, 201, 51, 0.28);
}

.recommendation-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.recommendation-card strong {
  font-size: 14px;
}

.confidence {
  color: var(--cyan);
  font-size: 12px;
}

.recommendation-card ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.card-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
}

.card-actions button:first-child {
  border-color: rgba(59, 227, 139, 0.35);
  color: var(--green);
}

.empty-state {
  padding: 14px;
  border: 1px solid rgba(59, 227, 139, 0.22);
  border-radius: 8px;
  background: rgba(59, 227, 139, 0.07);
  color: #c7f8dd;
  font-size: 13px;
}

.slider-label {
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

input[type="range"] {
  width: 100%;
  margin: 16px 0;
  accent-color: var(--blue);
}

.simulation-output,
.competitors {
  display: grid;
  gap: 8px;
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.simulation-output div,
.competitors div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid rgba(136, 165, 196, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.signals li {
  position: relative;
  padding-left: 18px;
  color: #d9e9fb;
  font-size: 13px;
}

.signals li::before {
  position: absolute;
  top: 8px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(59, 227, 139, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 227, 139, 0);
  }
}

@keyframes dash {
  to {
    stroke-dashoffset: -72;
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: flex;
    height: auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .nav-list {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }

  .ops-status {
    position: static;
    white-space: nowrap;
  }

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

@media (max-width: 760px) {
  main,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .sidebar,
  .panel-header {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .segmented {
    max-width: 100%;
  }

  .kpi-grid,
  .passenger-grid,
  .loyalty-grid,
  dl {
    grid-template-columns: 1fr;
  }

  .table-row {
    grid-template-columns: 1fr 0.7fr 0.7fr;
    row-gap: 4px;
  }

  .table-row span:nth-child(4),
  .table-row span:nth-child(5),
  .table-row span:nth-child(6) {
    display: none;
  }

  .map-legend {
    right: 8px;
    left: 8px;
    justify-content: space-between;
  }
}
