/**
 * 物流业务明细 — 页面级样式
 */

.vm-page.ldb-page.sob-page .vm-table-section {
  gap: 16px;
}

.vm-page.ldb-page.sob-page .vm-table-card > .ldb-table-wrap {
  max-height: calc(100vh - 560px);
}

/* —— KPI 汇总卡片（6 项关键指标，对齐租赁业务明细） —— */
.sob-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 1280px) {
  .sob-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .sob-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sob-kpi-card {
  --sob-kpi-accent: var(--ln-primary);
  --sob-kpi-accent-soft: color-mix(in srgb, var(--sob-kpi-accent) 12%, var(--ln-surface-card));
  --sob-kpi-accent-border: color-mix(in srgb, var(--sob-kpi-accent) 22%, var(--ln-hairline));
  --sob-kpi-icon-bg: color-mix(in srgb, var(--sob-kpi-accent) 14%, var(--ln-surface-card));
  --sob-kpi-icon-color: var(--sob-kpi-accent);

  position: relative;
  display: flex;
  min-height: 0;
  border-radius: var(--ln-radius-control);
  border: 1px solid var(--sob-kpi-accent-border);
  background:
    linear-gradient(
      145deg,
      var(--sob-kpi-accent-soft) 0%,
      var(--ln-surface-card) 58%
    );
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.sob-kpi-card:hover {
  border-color: color-mix(in srgb, var(--sob-kpi-accent) 38%, var(--ln-hairline));
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.05),
    0 10px 24px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.sob-kpi-card-accent {
  flex-shrink: 0;
  width: 3px;
  background: linear-gradient(
    180deg,
    var(--sob-kpi-accent) 0%,
    color-mix(in srgb, var(--sob-kpi-accent) 55%, transparent) 100%
  );
}

.sob-kpi-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px 8px 8px;
}

.sob-kpi-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sob-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--ln-radius-xs);
  background: var(--sob-kpi-icon-bg);
  color: var(--sob-kpi-icon-color);
}

.sob-kpi-label {
  flex: 1;
  min-width: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ln-muted);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.sob-kpi-val {
  margin: 0;
  padding-left: 30px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ln-ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.sob-kpi-val--profit,
.sob-val--rise {
  color: #dc2626;
}

.sob-kpi-val--loss,
.sob-val--fall {
  color: #16a34a;
}

.sob-kpi-tip {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: -2px -4px -2px 0;
  border-radius: var(--ln-radius-xs);
  color: var(--ln-muted-soft);
  cursor: help;
}

.sob-kpi-tip:hover,
.sob-kpi-tip:focus-visible {
  color: var(--ln-ink);
  background: color-mix(in srgb, var(--ln-ink) 6%, transparent);
  outline: none;
}

.sob-kpi-tip:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ln-primary) 35%, transparent);
}

.sob-kpi-tooltip {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: min(240px, 70vw);
  padding: 8px 10px;
  border-radius: var(--ln-radius-control);
  background: var(--ln-ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  box-shadow: var(--ln-shadow-hover);
  pointer-events: none;
}

.sob-kpi-tip:hover .sob-kpi-tooltip,
.sob-kpi-tip:focus-within .sob-kpi-tooltip {
  display: block;
}

.sob-kpi-card--neutral {
  --sob-kpi-accent: #64748b;
}

.sob-kpi-card--income {
  --sob-kpi-accent: var(--ln-primary);
}

.sob-kpi-card--cost {
  --sob-kpi-accent: #7c3aed;
}

.sob-kpi-card--deduction {
  --sob-kpi-accent: #0891b2;
}

.sob-kpi-card--profit {
  --sob-kpi-accent: #059669;
}

@media (prefers-reduced-motion: reduce) {
  .sob-kpi-card {
    transition: none;
  }

  .sob-kpi-card:hover {
    transform: none;
  }
}

.sob-import-error-step {
  margin-top: 4px;
}

.sob-import-error-summary {
  margin: 0 0 10px;
  font-size: 0.875rem;
  color: var(--ln-muted);
  line-height: 1.5;
}

.sob-import-error-summary strong {
  color: var(--ln-error);
  font-weight: 600;
}

.ldb-import-modal .vm-upload-zone {
  width: 100%;
  min-height: 120px;
}

.ldb-import-modal .vm-upload-zone p {
  margin: 8px 0 0;
  font-size: 0.875rem;
}
