:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-alt: #eef3f7;
  --line: #dbe3ea;
  --text: #17212b;
  --muted: #6b7785;
  --dark: #21313f;
  --blue: #2563eb;
  --teal: #0f766e;
  --green: #16803c;
  --amber: #b7791f;
  --red: #c24138;
  --shadow: 0 14px 36px rgba(23, 33, 43, 0.09);
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: #182431;
  color: #f8fafc;
}

.brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 50px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f2b84b;
  color: #1e293b;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #aebdcc;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c7d2de;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #243647;
  color: #ffffff;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #f2b84b;
}

.nav-item svg,
.topbar svg,
button svg {
  width: 18px;
  height: 18px;
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.eyebrow,
.sidebar-panel small {
  color: #aebdcc;
  font-size: 12px;
}

.sidebar-panel strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #33465a;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f2b84b;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar p,
.panel p,
.focus-item p,
.list-card p,
.vehicle-card p,
.deal-card p,
.task-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.search-box {
  display: grid;
  grid-template-columns: 18px minmax(180px, 280px);
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.primary-button,
.secondary-button,
.ghost-button,
.table-action,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.primary-button {
  padding: 0 14px;
  background: var(--teal);
  color: #ffffff;
}

.secondary-button {
  padding: 0 12px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--dark);
}

.ghost-button,
.table-action {
  padding: 0 10px;
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--dark);
}

.icon-button {
  width: 40px;
  height: 40px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--dark);
}

.icon-button.small {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.kpi-card,
.panel,
.store-card,
.list-card,
.vehicle-card,
.deal-card,
.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 33, 43, 0.03);
}

.kpi-card {
  position: relative;
  min-height: 146px;
  padding: 18px;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
}

.kpi-card.blue::after {
  background: var(--blue);
}

.kpi-card.amber::after {
  background: var(--amber);
}

.kpi-card.green::after {
  background: var(--green);
}

.kpi-card.red::after {
  background: var(--red);
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--teal);
}

.kpi-card span,
.kpi-card small {
  display: block;
  color: var(--muted);
}

.kpi-card strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 26px;
  letter-spacing: 0;
}

.split-layout,
.appraisal-layout,
.task-board {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
}

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

.funnel-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.funnel-row span,
.funnel-row strong {
  font-size: 13px;
}

.funnel-row div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf3;
}

.funnel-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.focus-list,
.compact-list,
.task-list {
  display: grid;
  gap: 10px;
}

.focus-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.focus-item:last-child {
  border-bottom: 0;
}

.focus-item strong,
.list-card strong,
.vehicle-card strong,
.deal-card strong,
.task-card strong {
  display: block;
  line-height: 1.35;
}

.focus-item time,
.muted,
.list-card small,
.deal-card small,
.task-card small {
  color: var(--muted);
  font-size: 12px;
}

.priority,
.status,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.priority.高 {
  background: #fee2e2;
  color: var(--red);
}

.priority.中 {
  background: #fef3c7;
  color: #996100;
}

.status.success {
  background: #dcfce7;
  color: var(--green);
}

.status.warning {
  background: #fef3c7;
  color: #996100;
}

.status.info {
  background: #dbeafe;
  color: var(--blue);
}

.status.neutral {
  background: #e5e7eb;
  color: #374151;
}

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

.store-card {
  padding: 14px;
}

.store-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.store-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.store-card dt {
  color: var(--muted);
  font-size: 12px;
}

.store-card dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--dark);
  color: #ffffff;
}

.data-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f8fafc;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.person-cell strong,
.person-cell span {
  display: block;
}

.person-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.empty-cell {
  height: 180px;
  color: var(--muted);
  text-align: center !important;
}

.calculator-panel {
  align-self: start;
}

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

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

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
  outline-color: var(--teal);
}

textarea {
  resize: vertical;
}

.wide-field {
  margin-top: 12px;
}

.valuation-result {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #eef8f6;
  border: 1px solid #b7e1da;
}

.valuation-result span,
.valuation-result dt {
  color: #55746f;
  font-size: 12px;
}

.valuation-result strong {
  display: block;
  margin-top: 4px;
  color: #0f5f58;
  font-size: 24px;
}

.valuation-result dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.valuation-result dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.list-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
}

.list-card-main {
  min-width: 0;
}

.list-card-main .status {
  margin-bottom: 8px;
}

.list-card-metrics {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.inventory-board,
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pipeline {
  grid-template-columns: repeat(5, minmax(230px, 1fr));
}

.board-column {
  min-height: 520px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2f7;
}

.board-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  margin-bottom: 10px;
}

.board-column header span,
.count-pill {
  background: #ffffff;
  color: var(--muted);
}

.vehicle-card,
.deal-card {
  margin-bottom: 10px;
  overflow: hidden;
}

.vehicle-photo {
  display: grid;
  place-items: center;
  height: 92px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.13), transparent 48%),
    #dbe7ec;
  color: var(--teal);
}

.vehicle-photo svg {
  width: 42px;
  height: 42px;
}

.vehicle-body,
.deal-card {
  padding: 13px;
}

.vehicle-prices,
.vehicle-actions,
.deal-top,
.deal-footer,
.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vehicle-prices {
  margin: 12px 0;
  font-size: 13px;
}

.vehicle-prices span,
.vehicle-actions span,
.deal-footer span {
  color: var(--muted);
  font-size: 12px;
}

.deal-card {
  display: grid;
  gap: 9px;
}

.deal-top span {
  color: var(--teal);
  font-weight: 800;
}

.deal-amount {
  font-size: 22px;
  font-weight: 850;
}

.task-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-column {
  min-height: 520px;
}

.task-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 13px;
}

.task-card.done {
  opacity: 0.62;
}

.task-card.done strong,
.task-card.done p {
  text-decoration: line-through;
}

.check-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--teal);
}

.task-meta {
  justify-content: flex-start;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.modal {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.52);
}

.modal form {
  padding: 18px;
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.modal-actions {
  justify-content: flex-end;
  margin: 18px 0 0;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand {
    grid-template-columns: 44px;
  }

  .brand div:last-child,
  .nav-item span,
  .sidebar-panel {
    display: none;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .kpi-grid,
  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout,
  .appraisal-layout,
  .task-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .brand {
    display: none;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 46px;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .table-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .search-box {
    flex: 1 1 100%;
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .kpi-grid,
  .store-grid,
  .form-grid,
  .valuation-result dl {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .list-card {
    grid-template-columns: 1fr;
  }

  .list-card-metrics {
    justify-items: start;
  }
}
