:root {
  --bmw-blue: #1665c1;
  --bmw-blue-soft: #eaf3ff;
  --bmw-ink: #102742;
  --bmw-muted: #5d7594;
  --bmw-line: #d6e3f1;
  --bmw-bg: #f2f6fb;
  --bmw-card: #ffffff;
  --bmw-shadow: 0 14px 30px rgba(17, 43, 74, 0.08);
}

* {
  box-sizing: border-box;
}

body.app-shell {
  margin: 0;
  font-family: "Ubuntu", "Segoe UI", sans-serif;
  font-weight: 500;
  color: var(--bmw-ink);
  background:
    radial-gradient(circle at 100% -8%, rgba(22, 101, 193, 0.16) 0, rgba(22, 101, 193, 0) 34%),
    radial-gradient(circle at -2% 105%, rgba(15, 53, 99, 0.08) 0, rgba(15, 53, 99, 0) 36%),
    var(--bmw-bg);
}

.app-container {
  max-width: 1520px;
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--bmw-line);
  background: linear-gradient(180deg, #fefeff 0%, #f5f9ff 100%);
  box-shadow: 0 8px 20px rgba(17, 43, 74, 0.05);
}

.brand-mark {
  width: 28px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid #cbdaeb;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
}

.mark-stripe {
  width: 4px;
  border-radius: 6px;
}

.mark-stripe.s1 {
  height: 11px;
  background: #00a8e1;
}

.mark-stripe.s2 {
  height: 13px;
  background: #1665c1;
}

.mark-stripe.s3 {
  height: 15px;
  background: #e53c3f;
}

.brand-main {
  font-family: "Ubuntu", "Segoe UI", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #112c4a;
}

.brand-sub {
  font-size: 0.66rem;
  color: #607997;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.navbar-brand,
.nav-link {
  color: #204465;
}

.nav-link:hover {
  color: #0f2e51;
}

.hero-panel {
  border: 1px solid var(--bmw-line);
  border-radius: 24px;
  background: linear-gradient(144deg, #ffffff 0%, #eef6ff 52%, #f8fbff 100%);
  box-shadow: var(--bmw-shadow);
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #4d6888;
}

.vin-input-wrap {
  max-width: 980px;
}

.landing-logo {
  font-family: "Ubuntu", "Segoe UI", sans-serif;
  font-size: 1.36rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.landing-logo span {
  color: var(--bmw-blue);
}

.feature-card {
  border: 1px solid var(--bmw-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--bmw-shadow);
}

.feature-card h3 {
  font-weight: 700;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf4ff;
  color: var(--bmw-blue);
  font-size: 1.2rem;
}

.auth-card,
.panel-card,
.sidebar-panel {
  border: 1px solid var(--bmw-line);
  border-radius: 18px;
  background: var(--bmw-card);
  box-shadow: var(--bmw-shadow);
}

.quick-request-bar {
  position: relative;
  border-radius: 20px;
  border-color: #cfe0f3;
  background:
    radial-gradient(circle at 12% 18%, rgba(22, 101, 193, 0.14) 0, rgba(22, 101, 193, 0) 38%),
    linear-gradient(147deg, #ffffff 0%, #f6fbff 54%, #edf5ff 100%);
  box-shadow: 0 18px 36px rgba(16, 53, 93, 0.12);
}

.quick-request-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.quick-request-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.quick-request-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #1f74cf 0%, #0f4f9f 100%);
  box-shadow: 0 10px 20px rgba(19, 86, 163, 0.24);
}

.quick-request-title {
  display: block;
  font-size: 1.03rem;
  color: #12365d;
  font-weight: 800;
}

.quick-request-subtitle {
  color: #587190;
  font-size: 0.82rem;
  font-weight: 600;
}

.quick-request-badge {
  border: 1px solid #c8dbef;
  border-radius: 999px;
  background: #f0f7ff;
  color: #285b8f;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.3rem 0.72rem;
}

.quick-vin-group .input-group-text {
  border: 1px solid #bfd4eb;
  background: #f2f8ff;
  color: #1f629f;
}

.quick-vin-group .form-control,
.quick-vin-input {
  border: 1px solid #bfd4eb;
  background: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.quick-vin-group .form-control:focus,
.quick-vin-input:focus {
  border-color: #4b8fd1;
  box-shadow: 0 0 0 0.2rem rgba(25, 104, 191, 0.16);
}

.quick-create-btn {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d74cc 0%, #3d95f2 100%);
  font-weight: 800;
  box-shadow: 0 14px 24px rgba(30, 106, 191, 0.24);
}

.quick-create-btn:hover,
.quick-create-btn:focus {
  background: linear-gradient(135deg, #1a69b8 0%, #3386dc 100%);
}

.quick-request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.quick-request-meta span {
  color: #5d7695;
  font-size: 0.79rem;
  font-weight: 700;
}

.quick-request-meta i {
  margin-right: 0.36rem;
  color: #2a69aa;
}

.flash {
  border-radius: 12px;
  border: 1px solid #bcd6f0;
  background: #edf6ff;
  color: #123f6d;
  padding: 0.72rem 0.9rem;
  margin-bottom: 0.75rem;
}

.flash.error {
  border-color: #efbfc8;
  background: #fff0f3;
  color: #922439;
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1100;
  display: grid;
  gap: 8px;
}

.toast {
  width: min(360px, calc(100vw - 24px));
  border-radius: 12px;
  border: 1px solid #cddff3;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16, 39, 66, 0.12);
  color: #18395f;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.toast-success {
  border-color: #bee9cf;
  background: #ebfaf2;
  color: #1d7a4d;
}

.toast-warning {
  border-color: #f0daab;
  background: #fff8ea;
  color: #85520f;
}

.toast-error {
  border-color: #f0c2ca;
  background: #fff0f3;
  color: #93253a;
}

.sidebar-panel {
  top: 1rem;
}

.sidebar-brand {
  font-family: "Ubuntu", "Segoe UI", sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sidebar-brand span {
  color: var(--bmw-blue);
}

.sidebar-nav .sidebar-link {
  border: 0;
  border-radius: 10px;
  color: #476283;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.sidebar-nav .sidebar-link i {
  width: 1rem;
}

.sidebar-nav .sidebar-link:hover {
  background: #eef5ff;
  color: #163a61;
}

.sidebar-nav .sidebar-link.active {
  background: var(--bmw-blue);
  color: #fff;
}

.panel-card .card-body,
.sidebar-panel .card-body {
  padding: 1rem;
}

.balance-block {
  display: grid;
  gap: 0.1rem;
}

.balance-block span {
  color: var(--bmw-muted);
  font-size: 0.78rem;
}

.balance-block strong {
  color: #148250;
  font-weight: 700;
}

.metric-card {
  border: 1px solid #d8e5f2;
  border-radius: 12px;
  background: #f9fcff;
  padding: 0.75rem;
  min-height: 100%;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--bmw-muted);
  font-size: 0.76rem;
}

.metric-card strong {
  font-size: 1.04rem;
  font-weight: 700;
  color: #103154;
}

.settings-row {
  border: 1px solid #d8e5f2;
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.55rem 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.settings-row span {
  color: var(--bmw-muted);
}

.settings-row strong {
  font-weight: 700;
  color: #113254;
}

.wallet-metric {
  border: 1px solid #d8e5f2;
  border-radius: 12px;
  background: #f9fcff;
  padding: 0.7rem;
}

.wallet-metric span,
.wallet-metric small,
.wallet-estimate,
.stamp,
.text-secondary {
  color: var(--bmw-muted) !important;
}

.wallet-metric strong {
  display: block;
  color: #103154;
  font-weight: 700;
}

.wallet-custom-form,
.dev-tools {
  border: 1px dashed #c3d9ee;
  border-radius: 12px;
  background: #f9fcff;
  padding: 0.8rem;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c4d9ee;
  border-radius: 999px;
  background: #edf4ff;
  color: #1c4f84;
  padding: 0.2rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  min-width: 700px;
}

.table-wrap code,
code {
  color: #21548a;
  background: #edf5ff;
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.report-stream .card-body {
  gap: 0.8rem;
}

.sync-pill {
  border-radius: 999px;
  border: 1px solid #c7dbef;
  background: #edf5ff;
  color: #1d5a95;
  padding: 0.16rem 0.66rem;
  font-size: 0.74rem;
  font-weight: 700;
}

.sync-pill.sync-error {
  border-color: #efc1ca;
  background: #fff0f3;
  color: #93253a;
}

.status-filters .chip-btn {
  border-radius: 999px;
  border: 1px solid #cfdded;
  background: #f3f8ff;
  color: #3a5678;
}

.status-filters .chip-btn.active,
.status-filters .chip-btn:hover {
  border-color: var(--bmw-blue);
  background: var(--bmw-blue);
  color: #fff;
}

.report-list {
  display: grid;
  gap: 0.8rem;
}

.report-item {
  border: 1px solid #d6e3f2;
  border-radius: 16px;
  background: linear-gradient(146deg, #ffffff 0%, #f6faff 72%, #eef5ff 100%);
  box-shadow: 0 12px 28px rgba(16, 39, 66, 0.08);
  padding: 0.95rem;
  display: grid;
  gap: 0.65rem;
  position: relative;
}

.report-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 8px;
  background: linear-gradient(180deg, #70b4ff 0%, #2f78c8 100%);
}

.report-item.report-status-completed {
  border-color: #bfe6d1;
  background: linear-gradient(148deg, #ffffff 0%, #f4fcf7 68%, #e9f8ef 100%);
}

.report-item.report-status-completed::before {
  background: linear-gradient(180deg, #2ab070 0%, #188f57 100%);
}

.report-item.report-status-processing::before {
  background: linear-gradient(180deg, #48a5ff 0%, #1d73c6 100%);
}

.report-item.report-status-waiting_manual::before {
  background: linear-gradient(180deg, #eead53 0%, #d2872a 100%);
}

.report-item.report-status-failed::before {
  background: linear-gradient(180deg, #e66a79 0%, #c53a4a 100%);
}

.report-top,
.report-bottom,
.report-state,
.progress-meta,
.detail-head,
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.report-ident {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-id {
  border-radius: 999px;
  border: 1px solid #c8d9ec;
  background: #eff6ff;
  color: #214b79;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.2rem 0.62rem;
}

.report-vin-meta {
  display: grid;
  gap: 0.1rem;
}

.report-vin {
  font-family: "Ubuntu", "Segoe UI", sans-serif;
  font-size: 1.15rem;
  color: #102a45;
  letter-spacing: 0.06em;
}

.report-caption {
  font-size: 0.75rem;
  color: #607a99;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.status-pill,
.eta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d0deed;
  padding: 0.22rem 0.66rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.eta-pill {
  background: #f2f7ff;
  color: #466584;
}

.status-pill.status-queued {
  background: #fff4dc;
  border-color: #ecd3a5;
  color: #88510a;
}

.status-pill.status-processing {
  background: #eaf4ff;
  border-color: #c1d9f1;
  color: #1f619d;
}

.status-pill.status-waiting_manual {
  background: #f0eaff;
  border-color: #dacbf3;
  color: #5f3d96;
}

.status-pill.status-completed {
  background: #e5f8ef;
  border-color: #bde9d0;
  color: #157347;
}

.status-pill.status-failed {
  background: #fff0f3;
  border-color: #efc2cb;
  color: #9c2b3e;
}

.progress-wrap {
  display: grid;
  gap: 0.35rem;
}

.progress-track {
  height: 12px;
  border: 1px solid #cfdeee;
  border-radius: 999px;
  background: linear-gradient(180deg, #e8eff8 0%, #dce8f4 100%);
  overflow: hidden;
  position: relative;
}

.progress-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.52) 48%, transparent 100%);
  animation: bmw-shimmer 2.4s linear infinite;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1665c1 0%, #59b5ff 100%);
  transition: width 0.5s ease;
}

.progress-fill.status-completed {
  background: linear-gradient(90deg, #25af6f 0%, #1a9058 100%);
}

.progress-fill.status-failed {
  background: linear-gradient(90deg, #e26b79 0%, #c53a4a 100%);
}

.progress-meta {
  font-size: 0.9rem;
  color: #3f6084;
}

.progress-meta strong {
  color: #1f5388;
}

.report-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.timeline-step {
  border: 1px solid #d7e4f2;
  border-radius: 10px;
  background: #f6faff;
  color: #5d7798;
  text-align: center;
  padding: 0.36rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.timeline-step.done {
  border-color: #c0e6d1;
  background: #e9f9f0;
  color: #1f8454;
}

.timeline-step.current {
  border-color: #b8d8f4;
  background: #eaf4ff;
  color: #1f639e;
}

.report-timeline.is-failed .timeline-step.current {
  border-color: #f2c7d0;
  background: #fff0f3;
  color: #a12d3f;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.report-action-btn {
  font-weight: 700;
  border-radius: 10px;
}

.action-download {
  box-shadow: 0 8px 16px rgba(26, 157, 90, 0.2);
}

.empty-state {
  border: 1px dashed #c6d8eb;
  border-radius: 14px;
  background: #f8fbff;
  padding: 1rem;
  text-align: center;
}

.detail-shell pre {
  background: #f7fbff;
  border: 1px solid #d9e4f1;
  border-radius: 12px;
  padding: 0.9rem;
  max-height: 420px;
  overflow: auto;
  font-size: 0.79rem;
}

.hidden {
  display: none !important;
}

@keyframes bmw-shimmer {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(110%);
  }
}

@media (max-width: 1199px) {
  .sidebar-panel {
    position: static !important;
  }
}

@media (max-width: 991px) {
  .topbar .navbar-brand {
    margin-right: 0;
  }

  .report-top,
  .report-bottom,
  .report-state,
  .detail-head,
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-vin {
    font-size: 1rem;
    letter-spacing: 0.03em;
  }

  .report-actions .btn {
    width: 100%;
  }

  .report-timeline {
    grid-template-columns: 1fr;
  }
}
