@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Inter:wght@400;500;600;700&display=swap');

.omnl-app,
.nasa-mission-root {
  --nasa-bg: #0f2847;
  --nasa-bg-deep: #0a1a30;
  --nasa-panel: #163a6b;
  --nasa-panel-elevated: #1c4680;
  --nasa-panel-border: #2d6bb8;
  --nasa-telemetry: #00d4ff;
  --nasa-nominal: #3dff8a;
  --nasa-caution: #ffb347;
  --nasa-critical: #fc3d21;
  --nasa-text: #e8f4ff;
  --nasa-muted: #9bb8d4;
  --nasa-mono: 'Share Tech Mono', ui-monospace, monospace;
}

html:has(.omnl-app),
html:has(.omnl-app) body {
  background: var(--nasa-bg);
  min-height: 100%;
}

.omnl-app {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(45, 107, 184, 0.45) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 100%, rgba(0, 212, 255, 0.12) 0%, transparent 45%),
    linear-gradient(180deg, var(--nasa-bg) 0%, var(--nasa-bg-deep) 100%);
  color: var(--nasa-text);
}

.nasa-icon--telemetry { color: var(--nasa-telemetry); }
.nasa-icon--nominal { color: var(--nasa-nominal); }
.nasa-icon--critical { color: var(--nasa-critical); }
.nasa-icon--caution { color: var(--nasa-caution); }
.nasa-icon--spin { animation: nasa-spin 1s linear infinite; }

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

.dash-page, .o24-page, .nasa-page, .cb-page {
  min-height: calc(100vh - 56px);
  font-family: 'Inter', sans-serif;
}

.nasa-panel, .dash-card, .o24-card, .cb-card {
  position: relative;
  background: linear-gradient(180deg, rgba(28, 70, 128, 0.92) 0%, rgba(22, 58, 107, 0.96) 100%);
  border: 1px solid var(--nasa-panel-border);
  border-radius: 2px;
  padding: 1.15rem 1.25rem;
  box-shadow: inset 0 1px 0 rgba(0, 212, 255, 0.08), 0 4px 24px rgba(0, 0, 0, 0.45);
}

.dash-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-top: 2px solid var(--nasa-telemetry);
  border-left: 2px solid var(--nasa-telemetry);
  opacity: 0.7;
}

.dash-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-bottom: 2px solid var(--nasa-telemetry);
  border-right: 2px solid var(--nasa-telemetry);
  opacity: 0.7;
}

.nasa-header {
  border: 1px solid var(--nasa-panel-border);
  background: rgba(22, 58, 107, 0.55);
  padding: 1rem 1.25rem;
}

.nasa-header__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-family: var(--nasa-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nasa-muted);
}

.nasa-mission-id {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--nasa-telemetry);
}

.nasa-header__body {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.nasa-header__title-row {
  display: flex;
  gap: 1rem;
}

.nasa-header__icon-wrap {
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--nasa-panel-border);
  background: rgba(0, 212, 255, 0.06);
}

.nasa-title, .dash-page-title {
  font-family: var(--nasa-mono);
  font-size: 1.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nasa-text);
  line-height: 1.2;
}

.dash-page-subtitle {
  margin-top: 0.35rem;
  color: var(--nasa-muted);
  font-size: 0.9rem;
  max-width: 48rem;
}

.nasa-badge, .dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--nasa-panel-border);
  font-family: var(--nasa-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nasa-badge--telemetry, .dash-badge--blue {
  background: rgba(0, 212, 255, 0.1);
  color: var(--nasa-telemetry);
  border-color: rgba(0, 212, 255, 0.35);
}

.nasa-badge--nominal, .dash-badge--green {
  background: rgba(61, 255, 138, 0.08);
  color: var(--nasa-nominal);
  border-color: rgba(61, 255, 138, 0.35);
}

.nasa-badge--caution, .dash-badge--gold {
  background: rgba(255, 179, 71, 0.08);
  color: var(--nasa-caution);
  border-color: rgba(255, 179, 71, 0.35);
}

.dash-banner {
  border-radius: 2px;
  padding: 1rem 1.15rem;
  border: 1px solid var(--nasa-panel-border);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.dash-banner__title {
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--nasa-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.dash-banner__detail {
  font-size: 0.85rem;
  color: var(--nasa-muted);
  line-height: 1.45;
}

.dash-banner--ok {
  background: rgba(61, 255, 138, 0.06);
  border-color: rgba(61, 255, 138, 0.35);
}
.dash-banner--ok .dash-banner__title { color: var(--nasa-nominal); }

.dash-banner--warn {
  background: rgba(255, 179, 71, 0.06);
  border-color: rgba(255, 179, 71, 0.35);
}
.dash-banner--warn .dash-banner__title { color: var(--nasa-caution); }

.dash-banner--error {
  background: rgba(252, 61, 33, 0.06);
  border-color: rgba(252, 61, 33, 0.35);
}
.dash-banner--error .dash-banner__title { color: var(--nasa-critical); }

.dash-banner--loading {
  background: rgba(22, 58, 107, 0.85);
}

.dash-stat-label {
  font-family: var(--nasa-mono);
  font-size: 0.65rem;
  color: var(--nasa-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.dash-stat-value {
  font-family: var(--nasa-mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--nasa-text);
  font-variant-numeric: tabular-nums;
}

.dash-stat-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--nasa-muted);
}

.dash-section-title {
  font-family: var(--nasa-mono);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nasa-telemetry);
}

.dash-section-subtitle {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--nasa-muted);
}

.dash-kv {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(30, 74, 138, 0.35);
}

.dash-kv:last-child { border-bottom: none; }
.dash-kv dt { color: var(--nasa-muted); flex-shrink: 0; }
.dash-kv dd { color: var(--nasa-text); text-align: right; word-break: break-word; }
.dash-kv .dash-kv-value--ok { color: var(--nasa-nominal); font-weight: 500; }

.dash-quick-links__label {
  font-family: var(--nasa-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--nasa-muted);
  margin-bottom: 0.5rem;
}

.dash-quick-links__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-family: var(--nasa-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--nasa-text);
  background: rgba(22, 58, 107, 0.75);
  border: 1px solid var(--nasa-panel-border);
  transition: border-color 0.15s, color 0.15s;
}

.dash-quick-links__chip:hover {
  border-color: var(--nasa-telemetry);
  color: var(--nasa-telemetry);
}

.dash-btn, .nasa-btn {
  padding: 0.55rem 1rem;
  border: 1px solid var(--nasa-panel-border);
  font-family: var(--nasa-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(10, 18, 36, 0.9);
  color: var(--nasa-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: border-color 0.15s, background 0.15s;
}

.dash-btn:hover, .nasa-btn:hover {
  border-color: var(--nasa-telemetry);
  background: rgba(0, 212, 255, 0.08);
}

.nasa-btn--primary {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--nasa-telemetry);
  color: var(--nasa-telemetry);
}

.nasa-btn--primary:hover {
  background: rgba(0, 212, 255, 0.25);
}

.dash-btn:disabled, .nasa-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nasa-input, .nasa-select {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  background: var(--nasa-panel-elevated);
  border: 1px solid var(--nasa-panel-border);
  color: var(--nasa-text);
  font-family: var(--nasa-mono);
  font-size: 0.9rem;
}

.nasa-input:focus, .nasa-select:focus {
  outline: none;
  border-color: var(--nasa-telemetry);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.25);
}

.nasa-inset-panel {
  background: rgba(15, 40, 71, 0.55);
  border: 1px solid rgba(45, 107, 184, 0.55);
  padding: 1rem;
}

.omnl-app-header {
  background: rgba(15, 40, 71, 0.92) !important;
  border-color: var(--nasa-panel-border) !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.nasa-nav-brand {
  font-family: var(--nasa-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nasa-telemetry) !important;
}

.nasa-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-family: var(--nasa-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nasa-muted);
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nasa-nav-link:hover {
  color: var(--nasa-text);
  background: rgba(0, 212, 255, 0.06);
}

.nasa-nav-link--active {
  color: var(--nasa-telemetry) !important;
  border-color: var(--nasa-panel-border);
  background: rgba(0, 212, 255, 0.1);
}

.nasa-table thead {
  background: rgba(11, 61, 145, 0.2);
  font-family: var(--nasa-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nasa-muted);
}

.nasa-table tbody tr { border-top: 1px solid rgba(30, 74, 138, 0.35); }
.nasa-table tbody tr:hover { background: rgba(0, 212, 255, 0.04); }

.trade-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px);
  background: transparent;
}

.trade-markets, .trade-panel, .trade-pair-header, .trade-recent, .trade-book {
  background: var(--nasa-panel) !important;
  border-color: var(--nasa-panel-border) !important;
}

.trade-center {
  min-height: 0;
  background: rgba(15, 40, 71, 0.35);
}

.trade-chart {
  background: var(--nasa-panel) !important;
  border-color: var(--nasa-panel-border) !important;
}

.trade-chart__canvas {
  min-height: 240px;
  border-radius: 2px;
  border: 1px solid var(--nasa-panel-border);
  background: linear-gradient(180deg, rgba(22, 58, 107, 0.95) 0%, rgba(15, 40, 71, 0.98) 100%);
}
.trade-market-row:hover { background: rgba(0, 212, 255, 0.08); }
.trade-market-row--active {
  background: rgba(0, 212, 255, 0.12);
  border-left: 2px solid var(--nasa-telemetry) !important;
}

.trade-orderbook { max-height: 360px; overflow-y: auto; font-family: var(--nasa-mono); }

@media (max-width: 1023px) {
  .trade-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
}

@media (min-width: 1024px) {
  .trade-layout { grid-template-columns: 240px 1fr 320px; }
}
