:root {
  color-scheme: light;
  --ink: #111827;
  --soft-ink: #273142;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: rgba(15, 23, 42, .10);
  --line-strong: rgba(15, 23, 42, .16);
  --bg: #f6f7f9;
  --bg-lift: #fbfbfd;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #ffffff;
  --brand: #0a84ff;
  --brand-dark: #0062cc;
  --accent: #12b886;
  --warning: #ff9f0a;
  --danger: #d92d20;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-md: 0 18px 55px rgba(15, 23, 42, .10);
  --radius: 8px;
  --radius-lg: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 16% 8%, rgba(10, 132, 255, .10), transparent 28rem),
    linear-gradient(180deg, var(--bg-lift), var(--bg));
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--brand);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(24px) saturate(160%);
}

.topbar .container-fluid {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-dot,
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg, #0a84ff, #111827);
  box-shadow: 0 10px 26px rgba(10, 132, 255, .28);
  font-weight: 800;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-user span {
  display: grid;
  justify-items: end;
  line-height: 1.15;
  color: var(--soft-ink);
  font-weight: 650;
}

.topbar-user small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 500;
}

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

.app-sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  min-height: calc(100vh - 64px);
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: rgba(247, 248, 250, .74);
  backdrop-filter: blur(20px) saturate(150%);
}

.nav-section {
  margin: 18px 12px 8px;
  color: var(--subtle);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-section:first-child {
  margin-top: 0;
}

.app-sidebar a {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 4px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--soft-ink);
  font-weight: 620;
  text-decoration: none;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}

.app-sidebar a:hover {
  background: rgba(10, 132, 255, .09);
  color: var(--brand-dark);
  transform: translateX(2px);
}

.app-main {
  width: min(1480px, 100%);
  padding: 34px;
}

.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-title h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 3.2vw, 3.6rem);
  font-weight: 780;
  line-height: .98;
  letter-spacing: 0;
}

.panel h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 760;
}

.panel,
.stat,
.login-card,
.public-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 22px;
}

.btn {
  border-radius: 999px;
  font-weight: 720;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, #148cff, #006ee6);
  box-shadow: 0 12px 26px rgba(10, 132, 255, .24);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: transparent;
  background: linear-gradient(180deg, #2a98ff, #0062cc);
  box-shadow: 0 15px 34px rgba(10, 132, 255, .30);
}

.btn-outline-primary {
  border-color: rgba(10, 132, 255, .28);
  color: var(--brand-dark);
  background: rgba(10, 132, 255, .04);
}

.btn-ghost {
  color: var(--soft-ink);
  background: rgba(17, 24, 39, .06);
  border: 0;
}

.btn-ghost:hover {
  background: rgba(17, 24, 39, .10);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.stat::after {
  content: "";
  position: absolute;
  inset: auto -20% -60% 45%;
  height: 130px;
  border-radius: 50%;
  background: rgba(10, 132, 255, .09);
}

.stat span,
.vehicle-facts span {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 2.35rem;
  line-height: 1;
  font-weight: 780;
}

.stat small {
  display: block;
  margin-top: 10px;
  color: var(--subtle);
}

.searchbar {
  margin-bottom: 18px;
}

.form-control,
.form-select {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, .84);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(10, 132, 255, .55);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, .12);
  background: #fff;
}

.field-label,
.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--soft-ink);
  font-size: .92rem;
  font-weight: 690;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.span-2 {
  grid-column: span 2;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom-color: var(--line);
}

.table tbody td {
  padding-top: 16px;
  padding-bottom: 16px;
  border-color: rgba(15, 23, 42, .07);
}

.list-group-item {
  padding: 14px 0;
  border-color: rgba(15, 23, 42, .07);
  background: transparent;
}

.list-group-item:hover {
  background: rgba(10, 132, 255, .05);
}

.vehicle-hero {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.vehicle-photo {
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(10, 132, 255, .10), rgba(18, 184, 134, .08)),
    #f8fafc;
}

.vehicle-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vehicle-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.vehicle-facts div {
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .62);
}

.vehicle-facts strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.timeline article {
  position: relative;
  padding: 0 0 20px 24px;
  margin: 0;
  border-left: 2px solid rgba(10, 132, 255, .22);
}

.timeline article::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(10, 132, 255, .12);
}

.timeline time {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
}

.timeline h3 {
  margin: 4px 0 6px;
  font-size: 1.05rem;
}

.order-link {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  color: var(--soft-ink);
  font-weight: 650;
  text-decoration: none;
}

.order-link:hover {
  color: var(--brand-dark);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: .76rem;
  letter-spacing: 0;
  font-weight: 820;
}

.login-screen,
.public-nfc {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(10, 132, 255, .18), transparent 32rem),
    radial-gradient(circle at 82% 72%, rgba(18, 184, 134, .12), transparent 28rem),
    linear-gradient(135deg, #f7f9fc, #eef2f7);
}

.login-wrap {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 24px;
  align-items: stretch;
}

.login-story,
.login-card,
.public-card {
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px) saturate(145%);
}

.login-story {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: clamp(30px, 5vw, 58px);
  overflow: hidden;
  position: relative;
}

.login-story::before {
  content: "";
  position: absolute;
  inset: 24px 24px auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, rgba(10, 132, 255, .9), rgba(18, 184, 134, .82), rgba(255, 159, 10, .76), rgba(10, 132, 255, .9));
  filter: blur(.2px);
  opacity: .16;
}

.brand-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 30px;
}

.login-story h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: .94;
  font-weight: 820;
  letter-spacing: 0;
}

.login-story > p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 34px;
}

.login-metrics span {
  display: grid;
  gap: 2px;
  min-height: 82px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .54);
  color: var(--muted);
}

.login-metrics strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.login-card {
  align-self: center;
  padding: clamp(26px, 4vw, 42px);
}

.form-heading {
  margin-bottom: 24px;
}

.form-heading h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  font-weight: 790;
}

.form-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
}

.login-card .field-label {
  margin-bottom: 16px;
}

.login-card .btn {
  margin-top: 6px;
}

.login-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

.scan-stage {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 34px;
  background:
    radial-gradient(circle at 50% 36%, rgba(10, 132, 255, .18), transparent 28rem),
    linear-gradient(180deg, #f8fbff, #eef3f8);
}

.scan-card {
  width: min(760px, 100%);
  padding: clamp(32px, 6vw, 70px);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(24px) saturate(150%);
}

.scan-card h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: .95;
  font-weight: 830;
}

.scan-card p:not(.eyebrow) {
  max-width: 580px;
  margin: 20px auto 28px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.scan-orbit {
  width: 112px;
  height: 112px;
  margin: 0 auto 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 132, 255, .08);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .12);
}

.scan-orbit span {
  width: 58px;
  height: 58px;
  display: block;
  border-radius: 50%;
  background: linear-gradient(145deg, #0a84ff, #12b886);
  box-shadow: 0 0 0 0 rgba(10, 132, 255, .28);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(10, 132, 255, .30); }
  70% { box-shadow: 0 0 0 28px rgba(10, 132, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0); }
}

.nfc-result {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.nfc-result code {
  display: block;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--radius);
  background: #f3f6fa;
  color: var(--soft-ink);
  overflow-wrap: anywhere;
}

.nfc-result img {
  width: 180px;
  height: 180px;
  border-radius: var(--radius);
}

.public-card {
  width: min(620px, 100%);
  padding: clamp(28px, 5vw, 50px);
  text-align: center;
}

.public-card h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  font-weight: 820;
}

.report-page {
  background: white;
  padding: 32px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-wrap {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .topbar .container-fluid {
    padding: 0 18px;
  }

  .topbar-user span {
    display: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: sticky;
    top: 64px;
    z-index: 10;
    min-height: auto;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-section {
    display: none;
  }

  .app-sidebar a {
    white-space: nowrap;
    margin: 0;
  }

  .app-main {
    padding: 22px;
  }

  .page-title {
    align-items: start;
    flex-direction: column;
  }

  .stat-grid,
  .form-grid,
  .vehicle-hero,
  .vehicle-facts,
  .login-metrics {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 560px) {
  .login-screen,
  .public-nfc,
  .scan-stage {
    padding: 14px;
  }

  .login-story,
  .login-card,
  .scan-card,
  .public-card,
  .panel {
    border-radius: var(--radius);
  }

  .login-story {
    padding: 28px;
  }
}

@media print {
  .no-print,
  .topbar,
  .app-sidebar {
    display: none !important;
  }

  body {
    background: white;
  }
}
