/**
 * 收款记录 — 对齐租赁合同管理 vm-page lc-page
 */
@import url('../../lease-contract-management/styles/lease-contract.css');

.vm-page.lc-page.pr-page .vm-kpi-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.vm-page.lc-page.pr-page .pr-kpi-card {
  cursor: default;
}

.vm-page.lc-page.pr-page .pr-kpi-card--clickable {
  cursor: pointer;
  border: 1px solid var(--ln-hairline, #e2e8f0);
  background: var(--ln-surface-card, #fff);
  font: inherit;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vm-page.lc-page.pr-page .pr-kpi-card--clickable:hover {
  border-color: rgba(50, 160, 110, 0.45);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.vm-page.lc-page.pr-page .pr-kpi-card--clickable:focus-visible {
  outline: 2px solid var(--ln-primary, #32a06e);
  outline-offset: 2px;
}

.vm-page.lc-page.pr-page .pr-kpi-card--clickable.pr-kpi-card--active {
  border-color: var(--ln-primary, #32a06e);
  box-shadow: 0 0 0 1px rgba(50, 160, 110, 0.2);
}

.pr-kpi-detail-modal__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--ln-hairline, #e2e8f0);
  font-size: 0.875rem;
  color: var(--ln-muted, #64748b);
}

.pr-kpi-detail-modal__summary strong {
  font-size: 1.125rem;
  color: var(--ln-body, #0f172a);
}

.pr-kpi-detail-modal__count {
  margin-left: auto;
  font-size: 0.8125rem;
}

/* KPI 明细弹窗 */
.pr-kpi-detail-modal .ant-modal-content {
  border-radius: var(--ln-radius-card, 12px);
  overflow: hidden;
  box-shadow: var(--ln-shadow-modal, 0 20px 40px rgba(24, 24, 27, 0.14));
}

.pr-kpi-detail-modal .ant-modal-header {
  margin-bottom: 0;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--ln-hairline, #e2e8f0);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.pr-kpi-detail-modal .ant-modal-body {
  padding: 16px 20px 12px;
  background: var(--ln-canvas-parchment, #f5f6f6);
}

.pr-kpi-detail-modal .ant-modal-footer {
  margin-top: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--ln-hairline, #e2e8f0);
  background: #fff;
}

.pr-kpi-detail-modal .ant-modal-close {
  top: 14px;
  inset-inline-end: 14px;
}

.pr-kpi-detail-modal__title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-right: 28px;
}

.pr-kpi-detail-modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.pr-kpi-detail-modal__icon--received {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
}

.pr-kpi-detail-modal__icon--linked {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.1);
}

.pr-kpi-detail-modal__icon--unlinked {
  color: #c2410c;
  background: rgba(194, 65, 12, 0.1);
}

.pr-kpi-detail-modal__title-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pr-kpi-detail-modal__title-main {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ln-ink, #18181b);
}

.pr-kpi-detail-modal__title-sub {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ln-muted, #71717a);
}

.pr-kpi-detail-modal__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pr-kpi-detail-modal__stats {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
  gap: 12px;
}

.pr-kpi-detail-modal__stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--ln-hairline, #e2e8f0);
  background: #fff;
}

.pr-kpi-detail-modal__stat-card--primary {
  border-color: rgba(50, 160, 110, 0.22);
  background: linear-gradient(135deg, rgba(50, 160, 110, 0.06) 0%, #fff 72%);
}

.pr-kpi-detail-modal__stat-card--linked {
  border-color: rgba(15, 118, 110, 0.22);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06) 0%, #fff 72%);
}

.pr-kpi-detail-modal__stat-card--unlinked {
  border-color: rgba(194, 65, 12, 0.2);
  background: linear-gradient(135deg, rgba(194, 65, 12, 0.05) 0%, #fff 72%);
}

.pr-kpi-detail-modal__stat-label {
  font-size: 0.75rem;
  color: var(--ln-muted, #71717a);
}

.pr-kpi-detail-modal__stat-val {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ln-ink, #18181b);
}

.pr-kpi-detail-modal__stat-val--linked {
  color: #0f766e;
}

.pr-kpi-detail-modal__stat-val--warn {
  color: #c2410c;
}

.pr-kpi-detail-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.pr-kpi-detail-modal__footer-hint {
  font-size: 0.75rem;
  color: var(--ln-muted, #94a3b8);
}

.pr-kpi-detail-filter {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--ln-hairline, #e2e8f0);
  background: #fff;
}

.pr-kpi-detail-filter__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.pr-kpi-detail-filter__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pr-kpi-detail-filter__field > span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ln-muted, #71717a);
}

.pr-kpi-detail-filter__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ln-hairline, #e2e8f0);
}

/* 认领 / 未关联总金额明细：筛选项与按钮单行排列 */
.pr-kpi-detail-filter--inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.pr-kpi-detail-filter--inline .pr-kpi-detail-filter__grid {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 10px 12px;
  grid-template-columns: unset;
}

.pr-kpi-detail-filter--inline .pr-kpi-detail-filter__field {
  flex: 1;
  min-width: 0;
}

.pr-kpi-detail-filter--inline .pr-kpi-detail-filter__field:nth-child(2) {
  flex: 1.25;
}

.pr-kpi-detail-filter--inline .pr-kpi-detail-filter__actions {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  flex-shrink: 0;
}

.pr-kpi-detail-panel__head {
  gap: 12px;
}

.pr-kpi-detail-panel__head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pr-kpi-detail-panel__export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pr-kpi-detail-panel__export:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vm-btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.8125rem;
}

@media (max-width: 640px) {
  .pr-kpi-detail-filter--inline {
    flex-direction: column;
    align-items: stretch;
  }

  .pr-kpi-detail-filter--inline .pr-kpi-detail-filter__grid {
    flex-direction: column;
  }

  .pr-kpi-detail-filter--inline .pr-kpi-detail-filter__actions {
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid var(--ln-hairline, #e2e8f0);
  }

  .pr-kpi-detail-filter__grid {
    grid-template-columns: 1fr;
  }

  .pr-kpi-detail-modal__stats {
    grid-template-columns: 1fr;
  }

  .pr-kpi-detail-modal__footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .pr-kpi-detail-modal__footer-hint {
    text-align: center;
  }
}

.vm-page.lc-page.pr-page .pr-kpi-val--linked {
  color: #0f766e;
}

.vm-page.lc-page.pr-page .pr-kpi-val--warn {
  color: #c2410c;
}

.pr-col-remark {
  max-width: 160px;
}

.pr-linked-empty {
  color: var(--ln-muted, #94a3b8);
  font-size: 0.8125rem;
}

.pr-linked-col {
  min-width: 88px;
}

.pr-linked-count-btn {
  padding: 0;
  border: none;
  background: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ln-primary, #32a06e);
  cursor: pointer;
}

.pr-linked-count-btn:hover {
  color: var(--ln-primary-focus, #2d8f62);
  text-decoration: underline;
}

.pr-linked-count-btn:focus-visible {
  outline: 2px solid var(--ln-primary, #32a06e);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 关联账单子表：对齐租赁合同展开行 — 100cqw 贴齐主表可视区，并为右侧冻结操作列留白 */
.vm-page.lc-page.pr-page {
  --pr-action-col-width: 108px;
}

.vm-page.lc-page.pr-page .lc-list-table--nested .ant-table-expanded-row > td {
  overflow: visible;
}

.vm-page.lc-page.pr-page .lc-list-table--nested .ant-table-expanded-row .pr-linked-bill-table-wrap {
  box-sizing: border-box;
  min-width: 0;
  overflow: visible;
}

@supports (width: 100cqw) {
  .vm-page.lc-page.pr-page .lc-list-table--nested .ant-table-expanded-row .pr-linked-bill-table-wrap {
    width: calc(100cqw - var(--pr-action-col-width, 108px));
    max-width: calc(100cqw - var(--pr-action-col-width, 108px));
  }
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table th,
.vm-page.lc-page.pr-page .pr-linked-bill-native-table td {
  padding: 5px 4px;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table thead th {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 11px;
  white-space: nowrap;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table__type {
  width: 9%;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table__info {
  width: 36%;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table__period {
  width: 10%;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table__money {
  width: 15%;
  text-align: left;
  white-space: nowrap;
  font-size: 11px;
}

.pr-bill-unreceived--negative {
  color: #c2410c;
  font-weight: 600;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table__info .vm-stack {
  min-width: 0;
  gap: 1px;
  line-height: 1.35;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table__info .primary,
.vm-page.lc-page.pr-page .pr-linked-bill-native-table__info .sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table__info .primary {
  font-size: 12px;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table__info .code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table__period {
  white-space: nowrap;
  font-size: 11px;
}

.vm-page.lc-page.pr-page .pr-linked-bill-native-table .pr-bill-type-tag {
  padding: 0 4px;
  font-size: 11px;
  white-space: nowrap;
  line-height: 1.5;
}

.pr-bill-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.pr-bill-type-tag--lease {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
}

.pr-bill-type-tag--self-operated {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.1);
}

.pr-bill-type-tag--clearing {
  color: #b45309;
  background: rgba(180, 83, 9, 0.1);
}

.pr-unlinked--pending,
.pr-unclaimed--pending {
  color: #c2410c;
  font-weight: 600;
}

.pr-bill-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--ln-hairline, #e2e8f0);
  font-size: 0.8125rem;
  color: var(--ln-muted, #64748b);
}

.pr-bill-summary strong {
  color: var(--ln-body, #334155);
  font-weight: 600;
}

.pr-bill-hint {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ln-muted, #64748b);
}

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

.pr-form-field--full {
  grid-column: 1 / -1;
}

.pr-required {
  color: #dc2626;
  font-style: normal;
}

/* 收款时间：单输入框 + 弹层双月历（与租赁合同 lc-filter-select 同高） */
.vm-page.lc-page.pr-page .pr-payment-range.ant-picker {
  width: 100%;
}

.vm-page.lc-page.pr-page .pr-payment-range.ant-picker .ant-picker-input > input {
  font-size: 0.875rem;
}

.vm-page.lc-page.pr-page .pr-payment-range.ant-picker .ant-picker-separator {
  color: var(--ln-muted, #64748b);
}

@media (max-width: 640px) {
  .pr-form-grid {
    grid-template-columns: 1fr;
  }

  .vm-page.lc-page.pr-page .vm-kpi-row {
    grid-template-columns: 1fr;
  }
}
