/* MT Blue — dashboard styling.
   Narrow left nav rail (shortcuts only) + wide main center screen where
   Setup controls and all results live. */

:root {
  --mtb-navy: #0b1f3a;
  --mtb-navy-light: #132a4d;
  --mtb-blue: #0d6efd;
  --mtb-bg: #f4f6fa;
  --mtb-text-muted: #6c757d;
  --mtb-border: #e3e7ee;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  background-color: var(--mtb-bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mtb-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar */
.mtb-navbar {
  background-color: var(--mtb-navy) !important;
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mtb-navbar-inner {
  display: flex !important;
  align-items: center;
  padding: 0.45rem 0.85rem;
}

.mtb-navbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mtb-menu {
  margin: 0;
}

.mtb-navbar .dropdown-toggle.mtb-menu-toggle::after {
  display: none !important;
}

.mtb-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 11px;
}

.mtb-hamburger span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: #ffffff;
}

.mtb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.mtb-brand-title {
  font-size: 1.05rem;
  font-weight: 650;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.mtb-brand-subtitle {
  font-size: 0.68rem;
  color: #9fb3d1;
}

.mtb-page-hidden {
  display: none !important;
}
.mtb-body {
  display: flex;
  flex: 1;
  align-items: stretch;
  min-height: 0;
}

/* Left nav rail — shortcuts only */
.mtb-nav-rail {
  width: 148px;
  flex-shrink: 0;
  background-color: var(--mtb-navy-light);
  color: #dbe4f3;
  padding: 1.25rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: sticky;
  top: 56px;
  align-self: flex-start;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.mtb-nav-rail-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c8fac;
  padding: 0 0.45rem;
}

.mtb-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mtb-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.7rem 0.4rem;
  border-radius: 0.5rem;
  color: #b9c7dd;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mtb-nav-link:hover {
  background-color: rgba(13, 110, 253, 0.18);
  color: #ffffff;
  text-decoration: none;
}

.mtb-nav-icon {
  font-size: 1.1rem;
  color: var(--mtb-blue);
}

.mtb-nav-rail-hint {
  margin-top: auto;
  font-size: 0.65rem;
  color: #7c8fac;
  line-height: 1.35;
  padding: 0.75rem 0.4rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Main center content */
.mtb-main {
  flex: 1;
  padding: 1.5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
  min-width: 0;
  scroll-behavior: smooth;
}

.mtb-section {
  scroll-margin-top: 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mtb-section-heading {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mtb-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mtb-navy);
}

.mtb-section-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--mtb-text-muted);
}

/* Setup panel (controls live here, not in the rail) */
.mtb-setup-card {
  background: #ffffff;
}

.mtb-field-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mtb-text-muted);
  margin-bottom: 0.45rem;
}

.mtb-field-label-spaced {
  margin-top: 1.1rem;
}

.mtb-radio-group .form-check {
  margin-right: 1rem;
  margin-bottom: 0.25rem;
}

.mtb-radio-group label,
.mtb-radio-group .form-check-label {
  font-size: 0.9rem;
  color: #0b1f3a !important;
  font-weight: 500;
}

.mtb-setup-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--mtb-border);
}

.mtb-run-button {
  font-weight: 600;
}

.mtb-run-status {
  font-size: 0.78rem;
  color: var(--mtb-text-muted);
  line-height: 1.35;
}

.mtb-run-status-error {
  color: #b02a37;
  font-weight: 500;
}

/* KPI / cards */
.mtb-kpi-col {
  display: flex;
}

.mtb-kpi-card {
  border: none;
  border-radius: 0.6rem;
  box-shadow: 0 1px 3px rgba(20, 30, 60, 0.08);
  width: 100%;
}

.mtb-kpi-icon {
  color: var(--mtb-blue);
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  display: block;
}

.mtb-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--mtb-navy);
}

.mtb-kpi-label {
  font-size: 0.76rem;
  color: var(--mtb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.mtb-card {
  border: none;
  border-radius: 0.6rem;
  box-shadow: 0 1px 3px rgba(20, 30, 60, 0.08);
}

.mtb-card .card-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--mtb-border);
  font-weight: 600;
  color: var(--mtb-navy);
  font-size: 0.9rem;
}

.mtb-ou-card .nav-tabs {
  border-bottom: 1px solid var(--mtb-border);
}

.mtb-ou-card .nav-link.active {
  color: var(--mtb-blue);
  font-weight: 600;
}

.mtb-params-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--mtb-text-muted);
  border-top: none;
}

.mtb-params-table td {
  font-size: 0.88rem;
  color: var(--mtb-navy);
  vertical-align: middle;
}

.mtb-params-name {
  font-weight: 600;
  white-space: nowrap;
}

.mtb-params-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mtb-params-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--mtb-text-muted);
  line-height: 1.45;
}

.mtb-params-subtitle {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.mtb-params-subtitle-spaced {
  margin-top: 1.5rem;
}

.mtb-footer {
  margin-top: auto;
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid var(--mtb-border);
  text-align: center;
  background: #ffffff;
}

.mtb-footer-disclaimer,
.mtb-footer-legal {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  color: var(--mtb-text-muted);
  line-height: 1.45;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.mtb-footer-links {
  margin: 0.15rem 0 0.5rem;
  font-size: 0.8rem;
}

.mtb-footer-links a {
  color: var(--mtb-navy);
  font-weight: 600;
  text-decoration: none;
}

.mtb-footer-links a:hover {
  text-decoration: underline;
}

.mtb-footer-sep {
  color: var(--mtb-text-muted);
}

/* About / legal */
.mtb-about-page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 2.5rem;
}

.mtb-about-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mtb-text-muted);
  margin: 0 0 0.4rem;
}

.mtb-about-hero h1 {
  font-size: 1.6rem;
  color: var(--mtb-navy);
  margin: 0 0 0.6rem;
}

.mtb-about-lede {
  color: var(--mtb-text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.mtb-about-notice {
  border: none;
  background: #f8f1f2;
  margin-bottom: 1.5rem;
}

.mtb-about-notice-title {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  color: #6b1d25;
}

.mtb-about-notice p {
  margin: 0;
  color: #4a2228;
}

.mtb-about-section {
  margin-bottom: 1.35rem;
}

.mtb-about-section h2 {
  font-size: 1.05rem;
  color: var(--mtb-navy);
  margin: 0 0 0.5rem;
}

.mtb-about-section p,
.mtb-about-section li {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #2c3544;
}

.mtb-about-back-wrap {
  margin-top: 1.75rem;
}

.mtb-about-back {
  font-weight: 600;
  color: var(--mtb-navy);
}

@media (max-width: 900px) {
  .mtb-body {
    flex-direction: column;
  }

  .mtb-nav-rail {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .mtb-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .mtb-nav-link {
    flex-direction: row;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
  }

  .mtb-nav-rail-hint {
    display: none;
  }
}


/* Run-analysis loading overlay */
.mtb-run-loading .dash-spinner {
  margin-top: 2rem;
}
