/**
 * 业务部台账 — vm-page + bdl-page
 * 列表壳层对齐：租赁合同管理（lc-page）、台账列表（ldb-page）
 */

.vm-page.bdl-page {
  padding-bottom: 48px;
}

.vm-page.bdl-page.bdl-page--list-dense .vm-filter-card {
  padding: 16px 20px 20px;
  margin-bottom: 16px;
}

.vm-page.bdl-page.bdl-page--list-dense .vm-filter-header {
  margin-bottom: 12px;
}

.vm-page.bdl-page.bdl-page--list-dense .vm-filter-title {
  font-size: 1rem;
}

.vm-page.bdl-page .vm-filter-card.ldb-filter-card {
  margin-bottom: 16px;
  overflow: visible;
}

.vm-page.bdl-page .vm-filter-grid.ldb-filter-grid--primary {
  margin-bottom: 0;
}

.vm-page.bdl-page .vm-filter-field .ant-select,
.vm-page.bdl-page .vm-filter-field .ant-picker {
  width: 100%;
}

.vm-page.bdl-page .vm-filter-field .ant-select .ant-select-selector,
.vm-page.bdl-page .vm-filter-field .ant-picker {
  min-height: var(--vm-control-height);
  height: var(--vm-control-height);
  border-radius: var(--ln-radius-sm);
  border-color: var(--ln-hairline-strong);
  font-size: 13px;
}

.vm-page.bdl-page .vm-filter-field .ant-select-multiple .ant-select-selector {
  min-height: var(--vm-control-height);
  height: auto;
  padding-block: 2px;
}

.vm-page.bdl-page .bdl-filter-radio.ant-radio-group {
  display: flex;
  width: 100%;
  gap: 0;
}

.vm-page.bdl-page .bdl-filter-radio .ant-radio-button-wrapper {
  flex: 1 1 0;
  min-width: 0;
  height: var(--vm-control-height);
  line-height: calc(var(--vm-control-height) - 2px);
  padding-inline: 10px;
  text-align: center;
  font-size: 13px;
}

.vm-page.bdl-page .vm-filter-actions.ldb-filter-actions {
  margin-top: 16px;
}

.vm-page.bdl-page .vm-table-section {
  min-width: 0;
  max-width: 100%;
}

.vm-page.bdl-page .vm-table-toolbar.bdl-table-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  min-height: var(--vm-btn-height);
  padding: 0 0 16px;
}

.vm-page.bdl-page .vm-table-toolbar.bdl-table-toolbar .vm-table-actions {
  margin-left: auto;
}

.vm-page.bdl-page .bdl-report-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.vm-page.bdl-page .bdl-report-caption {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ln-ink);
  letter-spacing: -0.01em;
}

.vm-page.bdl-page .bdl-report-scope {
  margin: 0;
  font-size: 13px;
  color: var(--ln-muted);
  line-height: 1.5;
}

.vm-page.bdl-page .bdl-report-hint {
  margin: 0;
  font-size: 12px;
  color: var(--ln-muted-soft);
  line-height: 1.45;
}

/* 列表宽表：横向滚动交给 Ant Table，外层不抢滚动上下文（对齐 lc-page） */
.vm-page.bdl-page .vm-table-card {
  overflow: visible;
}

.vm-page.bdl-page .vm-table-card > .vm-table-wrap {
  overflow: hidden;
  max-height: none;
  min-width: 0;
  border: 1px solid var(--ln-hairline);
  border-radius: var(--ln-radius-card);
  background: var(--ln-surface-card);
}

.vm-page.bdl-page .bdl-list-table.ant-table-wrapper,
.vm-page.bdl-page .bdl-list-table .ant-table-wrapper {
  min-width: 0;
  max-width: 100%;
}

/* —— 表格边框与表头（使用 Linear token，避免无效变量） —— */
.vm-page.bdl-page .bdl-list-table .ant-table-container {
  border-radius: var(--ln-radius-card);
  border: none;
}

.vm-page.bdl-page .bdl-list-table.ant-table-bordered .ant-table-container {
  border: none;
}

.vm-page.bdl-page .bdl-list-table .ant-table-thead > tr > th,
.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr:not(.ant-table-measure-row) > td,
.vm-page.bdl-page .bdl-list-table .ant-table-summary > tr > td {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding: 8px 12px !important;
  font-size: 13px;
  border-color: var(--ln-hairline) !important;
  box-sizing: border-box;
  overflow: visible;
  text-overflow: clip;
}

.vm-page.bdl-page .bdl-list-table.ant-table-bordered .ant-table-thead > tr > th,
.vm-page.bdl-page .bdl-list-table.ant-table-bordered .ant-table-tbody > tr:not(.ant-table-measure-row) > td,
.vm-page.bdl-page .bdl-list-table.ant-table-bordered .ant-table-summary > tr > td {
  border-inline-end: 1px solid var(--ln-hairline) !important;
  border-bottom: 1px solid var(--ln-hairline) !important;
}

/* 分组表：第一行业务板块 */
.vm-page.bdl-page .bdl-list-table--grouped .ant-table-thead > tr:first-child > th {
  background: var(--ln-surface-strong) !important;
  color: var(--ln-ink) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: center;
  border-bottom: 2px solid var(--ln-hairline-strong) !important;
}

/* 分组表：第二行 业绩/成本/盈亏 */
.vm-page.bdl-page .bdl-list-table--grouped .ant-table-thead > tr:nth-child(2) > th {
  background: var(--ln-canvas-soft) !important;
  color: var(--ln-muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  text-align: center;
}

/* 单层表头（按客户视图等） */
.vm-page.bdl-page .bdl-list-table:not(.bdl-list-table--grouped) .ant-table-thead > tr > th {
  background: var(--ln-canvas-soft) !important;
  color: var(--ln-muted) !important;
  font-weight: 500 !important;
  font-size: 12px !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr:not(.ant-table-measure-row) > td {
  color: var(--ln-body);
  background: var(--ln-surface-card);
}

.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-month:hover > td {
  background: var(--ln-canvas-soft) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-total > td,
.vm-page.bdl-page .bdl-list-table .ant-table-summary > tr > td {
  font-weight: 700;
  background: var(--ln-surface-strong) !important;
  color: var(--ln-ink) !important;
  border-top: 2px solid var(--ln-hairline-strong) !important;
}

/* 冻结列（对齐 lc-list-table--nested） */
.vm-page.bdl-page .bdl-list-table .ant-table-cell-fix-start,
.vm-page.bdl-page .bdl-list-table .ant-table-cell-fix-left {
  background: var(--ln-surface-card) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-thead > tr > th.ant-table-cell-fix-start,
.vm-page.bdl-page .bdl-list-table .ant-table-thead > tr > th.ant-table-cell-fix-left {
  z-index: 3;
  background: var(--ln-canvas-soft) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr:not(.ant-table-measure-row) > td.ant-table-cell-fix-start,
.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr:not(.ant-table-measure-row) > td.ant-table-cell-fix-left {
  z-index: 2;
  background: var(--ln-surface-card) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-month:hover > td.ant-table-cell-fix-start,
.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-month:hover > td.ant-table-cell-fix-left {
  background: var(--ln-canvas-soft) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-total > td.ant-table-cell-fix-start,
.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-total > td.ant-table-cell-fix-left,
.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-total > td.ant-table-cell-fix-end,
.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-total > td.ant-table-cell-fix-right {
  background: var(--ln-surface-strong) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-cell-fix-end:not(.ant-table-cell-scrollbar),
.vm-page.bdl-page .bdl-list-table .ant-table-cell-fix-right:not(.ant-table-cell-scrollbar) {
  background: var(--ln-surface-card) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-thead > tr > th.ant-table-cell-fix-end:not(.ant-table-cell-scrollbar),
.vm-page.bdl-page .bdl-list-table .ant-table-thead > tr > th.ant-table-cell-fix-right:not(.ant-table-cell-scrollbar) {
  z-index: 4;
  background: var(--ln-canvas-soft) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr:not(.ant-table-measure-row) > td.ant-table-cell-fix-end:not(.ant-table-cell-scrollbar),
.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr:not(.ant-table-measure-row) > td.ant-table-cell-fix-right:not(.ant-table-cell-scrollbar) {
  z-index: 3;
  background: var(--ln-surface-card) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-month:hover > td.ant-table-cell-fix-end:not(.ant-table-cell-scrollbar),
.vm-page.bdl-page .bdl-list-table .ant-table-tbody > tr.bdl-row-month:hover > td.ant-table-cell-fix-right:not(.ant-table-cell-scrollbar) {
  background: var(--ln-canvas-soft) !important;
}

.vm-page.bdl-page .bdl-list-table .ant-table-cell-fix-left-last::after {
  box-shadow: inset 10px 0 8px -8px rgba(15, 23, 42, 0.12);
}

.vm-page.bdl-page .bdl-list-table .ant-table-cell-fix-right-last::after,
.vm-page.bdl-page .bdl-list-table .ant-table-cell-fix-end-shadow-show:not(.ant-table-cell-scrollbar)::after {
  box-shadow: inset -10px 0 8px -8px rgba(15, 23, 42, 0.12);
}

/* 纵向滚动条占位缝：防止表头/表体右侧冻结列错位（对齐 lc-list-table--nested） */
.vm-page.bdl-page .bdl-list-table--nested .ant-table-thead > tr > th.ant-table-cell-fix-end:not(.ant-table-cell-scrollbar)::before,
.vm-page.bdl-page .bdl-list-table--nested .ant-table-tbody > tr > td.ant-table-cell-fix-end:not(.ant-table-cell-scrollbar)::before,
.vm-page.bdl-page .bdl-list-table--nested .ant-table-thead > tr > th.ant-table-cell-fix-right:not(.ant-table-cell-scrollbar)::before,
.vm-page.bdl-page .bdl-list-table--nested .ant-table-tbody > tr > td.ant-table-cell-fix-right:not(.ant-table-cell-scrollbar)::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: -17px;
  width: 17px;
  background: inherit;
  pointer-events: none;
}

.vm-page.bdl-page .bdl-list-table--nested .ant-table-cell-scrollbar {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: none !important;
  visibility: hidden;
}

.vm-page.bdl-page .bdl-list-table--nested .ant-table-container {
  overflow: hidden;
}

.vm-page.bdl-page .bdl-list-table--nested .ant-table-content {
  overflow: auto hidden;
}

/* 金额列最小宽度，避免合计行大额被裁切 */
.vm-page.bdl-page .bdl-list-table .col-amount,
.vm-page.bdl-page .bdl-list-table .col-summary {
  min-width: 128px;
}

.vm-page.bdl-page .bdl-list-table .col-summary {
  min-width: 148px;
}

.vm-page.bdl-page .bdl-list-table .bdl-amount-cell {
  display: inline-block;
  max-width: 100%;
  text-align: right;
}

.vm-page.bdl-page .bdl-list-table .biz-standbook-perf-link,
.vm-page.bdl-page .biz-standbook-perf-link {
  cursor: pointer;
  color: var(--ln-primary);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  font: inherit;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  max-width: none;
  overflow: visible;
  text-align: inherit;
  white-space: nowrap;
}

/* 钻取子页表格：复用主表边框规范 */
.vm-page.bdl-page .bdl-drill-card .biz-standbook-table.ant-table-bordered .ant-table-thead > tr > th,
.vm-page.bdl-page .bdl-drill-card .biz-standbook-table.ant-table-bordered .ant-table-tbody > tr:not(.ant-table-measure-row) > td,
.vm-page.bdl-page .bdl-drill-card .biz-standbook-table.ant-table-bordered .ant-table-summary > tr > td {
  border-color: var(--ln-hairline) !important;
  border-inline-end: 1px solid var(--ln-hairline) !important;
  border-bottom: 1px solid var(--ln-hairline) !important;
  padding: 8px 10px !important;
  font-size: 13px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.vm-page.bdl-page .bdl-drill-card .biz-standbook-table .ant-table-thead > tr > th {
  background: var(--ln-canvas-soft) !important;
  color: var(--ln-muted) !important;
  font-weight: 500 !important;
}

.vm-page.bdl-page .bdl-drill-card .biz-standbook-table-wrap,
.vm-page.bdl-page .bdl-drill-card .biz-standbook-table {
  border: 1px solid var(--ln-hairline);
  border-radius: var(--ln-radius-card);
  overflow: hidden;
}

.vm-page.bdl-page .biz-standbook-perf-link:hover {
  color: var(--ln-primary-focus);
  background: var(--ln-primary-soft);
}

.vm-page.bdl-page .biz-standbook-perf-link:focus {
  outline: 2px solid var(--ln-primary);
  outline-offset: 2px;
}

.vm-page.bdl-page .bdl-amount-neg {
  color: #b91c1c;
  font-weight: 600;
}

/* 钻取子页 */
.vm-page.bdl-page .bdl-drill-card {
  padding: 16px 20px 20px;
}

.vm-page.bdl-page .bdl-drill-section {
  margin-top: 0;
}

.vm-page.bdl-page .bdl-drill-toolbar {
  align-items: center;
  padding-bottom: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px 16px;
}

.vm-page.bdl-page .bdl-drill-toolbar-spacer {
  width: 88px;
}

.vm-page.bdl-page .bdl-drill-toolbar--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding-bottom: 16px;
}

.vm-page.bdl-page .bdl-drill-toolbar--inline .bdl-drill-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.vm-page.bdl-page .bdl-drill-heading {
  flex: 1;
  text-align: center;
  padding: 0 12px;
}

.vm-page.bdl-page .bdl-drill-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ln-ink);
}

.vm-page.bdl-page .bdl-drill-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ln-muted);
}

@media (prefers-reduced-motion: reduce) {
  .vm-page.bdl-page .biz-standbook-perf-link {
    transition: none;
  }
}
