:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #162033;
  --muted: #68758a;
  --line: #dce4ef;
  --soft: #eef4fb;
  --brand: #1d65d8;
  --brand-2: #123d85;
  --good: #0e8f62;
  --warn: #b7791f;
  --bad: #b42318;
  --shadow: 0 16px 40px rgba(31, 45, 70, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(29, 101, 216, 0.12), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 30%);
}

.app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.app-frame.nav-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.app-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  color: #fff;
  background: linear-gradient(180deg, #122b52 0%, #0b1930 100%);
  z-index: 10;
}

.nav-brand,
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.brand-mark,
.avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand);
  font-weight: 900;
}

.nav-toggle,
.logout-btn {
  margin-left: auto;
  padding: 8px;
  color: #c8d6eb;
  background: transparent;
  font-size: 22px;
}

.nav-items {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  color: #c8d6eb;
  background: transparent;
  text-align: left;
  font-weight: 750;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-icon {
  width: 28px;
  flex: 0 0 28px;
  text-align: center;
}

.nav-user {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.user-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.user-copy strong,
.user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy span {
  color: #9eb0ca;
  font-size: 11px;
}

.nav-collapsed .nav-label {
  display: none;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-form {
  margin-top: 28px;
}

.login-title {
  display: grid;
  gap: 3px;
  color: var(--brand-2);
  letter-spacing: 0;
}

.login-title::after {
  content: "";
  width: 36px;
  height: 3px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--brand);
}

.login-title-brand {
  display: block;
  font-size: clamp(40px, 6vw, 46px);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.login-title-system {
  display: block;
  color: #53647d;
  font-size: clamp(21px, 3vw, 24px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

html[lang="zh-CN"] .login-title-system {
  letter-spacing: 0.08em;
}

.login-title + .subtitle {
  margin-top: 16px;
}

.login-copyright {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.demo-credentials {
  margin-top: 20px;
  padding: 11px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  text-align: center;
}

.language-selector {
  display: inline-flex;
  width: fit-content;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.language-selector button {
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}

.language-selector button.active {
  color: #fff;
  background: var(--brand);
}

.login-language {
  margin-top: 22px;
}

.nav-language {
  margin-top: auto;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.nav-language button {
  color: #b9c8dc;
}

.nav-language button.active {
  background: rgba(255, 255, 255, 0.2);
}

.nav-language + .nav-user {
  margin-top: 12px;
}

.nav-collapsed .nav-language {
  display: grid;
  width: 100%;
}

.form-error {
  min-height: 18px;
  color: var(--bad);
  font-size: 13px;
}

.management-page {
  display: grid;
  gap: 22px;
  padding: 32px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.permission-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  padding: 28px 32px 20px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.045em;
}

.subtitle {
  color: var(--muted);
  max-width: 760px;
  line-height: 1.55;
  margin: 12px 0 0;
}

.hero-actions,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 750;
  box-shadow: 0 8px 16px rgba(29, 101, 216, 0.18);
}

.btn.secondary {
  background: #e8eef8;
  color: var(--brand-2);
  box-shadow: none;
}

.btn.danger {
  background: #fee4e2;
  color: var(--bad);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 20px;
  padding: 0 32px 32px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 228, 239, 0.86);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.panel-header {
  padding: 20px 20px 0;
}

.panel-body {
  padding: 20px;
}

.stack {
  display: grid;
  gap: 14px;
}

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

.full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
}

.checkbox-row input {
  width: auto;
}

.vin-decode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.vin-decode-row .btn {
  box-shadow: none;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.toolbar input,
.toolbar select {
  max-width: 260px;
}

.vehicle-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
}

.vehicle-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: left;
}

.vehicle-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 101, 216, 0.12);
}

.vin {
  font-weight: 900;
  letter-spacing: 0.04em;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
  color: var(--brand-2);
  background: #eaf1ff;
  white-space: nowrap;
}

.badge.good {
  color: var(--good);
  background: #e7f8ef;
}

.badge.warn {
  color: var(--warn);
  background: #fff4df;
}

.detail {
  display: grid;
  gap: 18px;
}

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

.metric {
  background: var(--soft);
  border-radius: 16px;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
}

.tab {
  padding: 13px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  border-bottom: 3px solid transparent;
}

.tab.active {
  color: var(--brand);
  border-color: var(--brand);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

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

.clickable-row {
  cursor: pointer;
  transition: background 140ms ease;
}

.clickable-row:hover {
  background: var(--soft);
}

.back-link {
  margin: 0 0 14px;
  padding: 0;
  color: var(--brand);
  background: transparent;
  font-weight: 800;
}

.detail-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.detail-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.detail-field strong {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.5;
}

.account-detail .field-group .detail-field strong {
  font-size: 14px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
}

.event {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

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

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fff;
}

.notice {
  margin-top: 12px;
  padding: 12px;
  background: #fff8e8;
  border: 1px solid #ffe0a3;
  border-radius: 14px;
  color: #7a4d07;
  font-size: 13px;
  line-height: 1.45;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 24, 39, 0.48);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
}

.modal {
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-body {
  padding: 24px;
}

.cost-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 120px 90px auto;
  gap: 8px;
  align-items: end;
}

.account-manager {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.account-form {
  gap: 18px;
}

.form-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}

.form-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.form-section-heading h3,
.field-group h4 {
  margin: 0;
}

.form-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

.field-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--soft);
}

.field-group h4 {
  color: var(--brand-2);
  font-size: 13px;
}

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

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

.muted {
  color: var(--muted);
}

.right {
  text-align: right;
}

@media (max-width: 980px) {
  .app-frame,
  .app-frame.nav-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .app-nav .nav-label {
    display: none;
  }
  .hero,
  .layout {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .app-frame,
  .app-frame.nav-collapsed {
    display: block;
  }

  .app-nav {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
  }

  .nav-items {
    display: flex;
    margin: 0 0 0 12px;
  }

  .nav-user {
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
  }

  .nav-toggle,
  .nav-user .avatar {
    display: none;
  }

  .management-page {
    padding: 18px;
  }

  .permission-guide {
    grid-template-columns: 1fr;
  }
  .hero {
    display: grid;
  }

  .form-grid,
  .summary-grid,
  .event,
  .cost-row,
  .account-manager,
  .role-grid,
  .financial-groups,
  .triple-grid {
    grid-template-columns: 1fr;
  }

  .form-section-heading {
    display: grid;
  }
}
