/* 车辆维修明细 — 台账管理 · 对齐 lease-business-ledger / ledger-shared DESIGN.md */

@import '../../lease-business-ledger/styles/index.css';

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

.mldb-page .ldb-page-header {
  margin-bottom: 16px;
}

.mldb-page .ldb-page-header h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ln-ink);
  letter-spacing: -0.02em;
}

.mldb-page .vm-filter-field .ant-picker,
.mldb-page .vm-filter-field .ant-select .ant-select-selector {
  min-height: var(--vm-control-height);
  border-radius: var(--ln-radius-control);
  border-color: var(--ln-hairline);
  font-size: 0.875rem;
}

.mldb-page .vm-filter-field .ant-picker:hover,
.mldb-page .vm-filter-field .ant-select:not(.ant-select-disabled):hover .ant-select-selector {
  border-color: var(--ln-primary);
}

.mldb-page .vm-filter-field .ant-picker-focused,
.mldb-page .vm-filter-field .ant-select-focused .ant-select-selector {
  border-color: var(--ln-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ln-primary) 18%, transparent);
}

.mldb-page .vm-table-card > .ldb-table-wrap {
  overflow: auto;
  scrollbar-gutter: stable;
  max-height: calc(100vh - 640px);
  min-width: 0;
}

/* Ant Design Table → 租赁业务台账 ldb-table 视觉规范 */
.mldb-page .mldb-ant-table.ldb-table {
  min-width: 100%;
}

.mldb-page .mldb-ant-table .ant-table {
  font-size: 0.8125rem;
  background: transparent;
}

.mldb-page .mldb-ant-table .ant-table-container,
.mldb-page .mldb-ant-table .ant-table-content,
.mldb-page .mldb-ant-table table {
  border-radius: 0;
}

.mldb-page .mldb-ant-table .ant-table-thead > tr > th,
.mldb-page .mldb-ant-table .ant-table-thead .ant-table-cell {
  padding: 10px 12px !important;
  height: auto !important;
  white-space: nowrap;
  color: var(--ln-muted) !important;
  font-weight: 500 !important;
  font-size: 0.75rem !important;
  letter-spacing: 0;
  text-transform: none;
  background: var(--ln-canvas-soft) !important;
  border-bottom: 1px solid var(--ln-hairline) !important;
  border-inline-end: none !important;
  text-align: left;
  vertical-align: middle;
  transition: background-color 0.18s ease;
}

.mldb-page .mldb-ant-table .ant-table-thead > tr > th.ant-table-cell-fix-left,
.mldb-page .mldb-ant-table .ant-table-thead > tr > th.ant-table-cell-fix-right,
.mldb-page .mldb-ant-table .ant-table-thead > tr > th.sticky-col-left,
.mldb-page .mldb-ant-table .ant-table-thead > tr > th.sticky-col-right {
  z-index: 3;
  background: var(--ln-canvas-soft) !important;
}

.mldb-page .mldb-ant-table .ant-table-tbody > tr:not(.ant-table-measure-row) > td {
  padding: 10px 12px !important;
  vertical-align: middle !important;
  font-size: 0.8125rem;
  color: var(--ln-ink);
  border-bottom: 1px solid var(--ln-hairline) !important;
  border-inline-end: none !important;
  background: var(--ln-surface-card);
  transition: background-color 0.18s ease;
}

.mldb-page .mldb-ant-table .ant-table-tbody > tr.maint-row-data:hover > td {
  background: var(--ln-canvas-soft) !important;
}

.mldb-page .mldb-ant-table .ant-table-tbody > tr.maint-row-data:hover > td.ant-table-cell-fix-left,
.mldb-page .mldb-ant-table .ant-table-tbody > tr.maint-row-data:hover > td.ant-table-cell-fix-right,
.mldb-page .mldb-ant-table .ant-table-tbody > tr.maint-row-data:hover > td.sticky-col-left,
.mldb-page .mldb-ant-table .ant-table-tbody > tr.maint-row-data:hover > td.sticky-col-right {
  background: var(--ln-canvas-soft) !important;
}

.mldb-page .mldb-ant-table .ant-table-tbody > tr > td.ant-table-cell-fix-left,
.mldb-page .mldb-ant-table .ant-table-tbody > tr > td.ant-table-cell-fix-right,
.mldb-page .mldb-ant-table .ant-table-tbody > tr > td.sticky-col-left,
.mldb-page .mldb-ant-table .ant-table-tbody > tr > td.sticky-col-right {
  z-index: 2;
  background: var(--ln-surface-card);
}

.mldb-page .mldb-ant-table .ant-table-cell-fix-left-last::after,
.mldb-page .mldb-ant-table .ant-table-cell-fix-right-first::after {
  box-shadow: none !important;
}

.mldb-page .mldb-ant-table .ant-table-summary > tr > td {
  font-weight: 700;
  background: var(--ln-surface-muted, #f8fafc) !important;
  color: var(--ln-ink) !important;
  border-top: 2px solid var(--ln-hairline) !important;
  border-bottom: none !important;
  padding: 10px 12px !important;
}

.mldb-page .mldb-ant-table .ant-table-summary .ldb-col-money {
  text-align: left;
}

.mldb-page .ldb-cell-readonly {
  color: var(--ln-muted);
  background: var(--ln-surface-muted, #f8fafc);
  border-radius: var(--ln-radius-xs);
  padding: 4px 8px;
}

.mldb-page .maint-inline-input {
  width: 100%;
}

.mldb-page .mldb-col-status {
  white-space: nowrap;
}

.mldb-page .mldb-status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  max-width: 100%;
}

.mldb-page .mldb-table-hint {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: var(--ln-radius-control);
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
}

.mldb-page .mldb-table-hint__icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: #d97706;
}

.mldb-page .mldb-table-hint__text {
  margin: 0;
  min-width: 0;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .mldb-page .mldb-table-hint {
    width: auto;
  }

  .mldb-page .mldb-table-hint__text {
    white-space: normal;
  }
}

.mldb-page .vm-table-toolbar.ldb-table-toolbar {
  justify-content: space-between;
  gap: 12px;
}

.mldb-page .maint-repair-date-picker,
.mldb-page .maint-repair-date-picker .ant-picker-input {
  width: 100%;
  min-width: 132px;
}

.mldb-page .maint-repair-date-picker .ant-picker-input > input {
  min-width: 118px;
}

.mldb-page .maint-row-tier-0 > td {
  background: var(--ln-surface-muted, #f8fafc) !important;
}

.mldb-page .mldb-ant-table .ant-table-tbody > tr.maint-row-tier-0:hover > td {
  background: color-mix(in srgb, var(--ln-canvas-soft) 85%, var(--ln-surface-muted, #f8fafc)) !important;
}

.mldb-page .maint-row-tier-1 > td {
  background: var(--ln-surface-card) !important;
}

.mldb-page .maint-row-tier-2 > td {
  background: #fffbeb !important;
}

.mldb-page .mldb-ant-table .ant-table-tbody > tr.maint-row-tier-2:hover > td {
  background: color-mix(in srgb, var(--ln-canvas-soft) 70%, #fffbeb) !important;
}

.mldb-page .maint-row-tier-boundary > td {
  border-top: 2px solid color-mix(in srgb, var(--ln-primary) 35%, var(--ln-hairline)) !important;
}

.mldb-page .maint-action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--ln-radius-control);
  cursor: pointer;
  color: var(--ln-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.mldb-page .maint-action-icon-btn:hover {
  background: color-mix(in srgb, var(--ln-primary) 10%, transparent);
  color: var(--ln-primary);
}

.mldb-page .maint-action-icon-btn.maint-action-icon-danger:hover {
  background: color-mix(in srgb, var(--ln-error) 10%, transparent);
  color: var(--ln-error);
}

.mldb-page .maint-action-icon-btn.is-disabled {
  color: var(--ln-muted-soft);
  cursor: not-allowed;
  pointer-events: none;
}

.mldb-page .maint-row-more-btn.maint-action-icon-btn:hover {
  background: var(--ln-surface-muted, #f5f5f5);
  color: var(--ln-ink);
}

.mldb-page .mldb-add-row-btn {
  width: 100%;
  margin-top: 12px;
}

.mldb-page .mldb-add-row-btn.ant-btn-dashed {
  border-color: var(--ln-hairline);
  color: var(--ln-muted);
  border-radius: var(--ln-radius-control);
  min-height: var(--vm-control-height);
}

.mldb-page .mldb-add-row-btn.ant-btn-dashed:hover {
  border-color: var(--ln-primary);
  color: var(--ln-primary);
}

.mldb-page .mldb-bear-by-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--ln-radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.mldb-page .mldb-bear-by-tag--customer {
  color: #0369a1;
  background: #e0f2fe;
}

.mldb-page .mldb-bear-by-tag--company {
  color: #b45309;
  background: #fef3c7;
}

.mldb-page .mldb-attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--ln-hairline);
  border-radius: var(--ln-radius-control);
  background: var(--ln-surface-card);
  color: var(--ln-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.mldb-page .mldb-attach-btn:hover {
  border-color: var(--ln-primary);
  color: var(--ln-primary);
  background: color-mix(in srgb, var(--ln-primary) 6%, var(--ln-surface-card));
}

.mldb-page .mldb-attach-btn:focus-visible {
  outline: 2px solid var(--ln-primary);
  outline-offset: 2px;
}

.mldb-page .mldb-attach-btn.has-files {
  color: var(--ln-primary);
  border-color: color-mix(in srgb, var(--ln-primary) 35%, var(--ln-hairline));
  background: color-mix(in srgb, var(--ln-primary) 8%, var(--ln-surface-card));
}

.mldb-page .mldb-attach-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--ln-radius-pill);
  background: var(--ln-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.mldb-attach-modal .mldb-attach-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mldb-attach-modal .mldb-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.mldb-attach-modal .mldb-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--ln-hairline);
  border-radius: var(--ln-radius-control);
  background: var(--ln-surface-muted, #f8fafc);
}

.mldb-attach-modal .mldb-attach-kind {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: var(--ln-radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.mldb-attach-modal .mldb-attach-kind--image {
  color: #0369a1;
  background: #e0f2fe;
}

.mldb-attach-modal .mldb-attach-kind--word {
  color: #1d4ed8;
  background: #dbeafe;
}

.mldb-attach-modal .mldb-attach-kind--excel {
  color: #047857;
  background: #d1fae5;
}

.mldb-attach-modal .mldb-attach-kind--pdf {
  color: #b91c1c;
  background: #fee2e2;
}

.mldb-attach-modal .mldb-attach-kind--other {
  color: #475569;
  background: #e2e8f0;
}

.mldb-attach-modal .mldb-attach-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mldb-attach-modal .mldb-attach-name {
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  color: var(--ln-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mldb-attach-modal .mldb-attach-name:hover {
  color: var(--ln-primary);
  text-decoration: underline;
}

.mldb-attach-modal .mldb-attach-name:focus-visible {
  outline: 2px solid var(--ln-primary);
  outline-offset: 2px;
}

.mldb-attach-modal .mldb-attach-size {
  font-size: 0.75rem;
  color: var(--ln-muted);
}

.mldb-attach-modal .mldb-attach-remove {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--ln-error, #dc2626);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--ln-radius-control);
}

.mldb-attach-modal .mldb-attach-remove:hover {
  background: color-mix(in srgb, var(--ln-error, #dc2626) 10%, transparent);
}

.mldb-attach-modal .mldb-attach-empty {
  margin: 0;
  padding: 12px;
  text-align: center;
  color: var(--ln-muted);
  font-size: 0.875rem;
  background: var(--ln-surface-muted, #f8fafc);
  border-radius: var(--ln-radius-control);
}

.mldb-attach-modal .mldb-attach-readonly-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ln-muted);
}

.mldb-attach-modal .mldb-attach-upload.ant-upload-wrapper .ant-upload-drag {
  border-radius: var(--ln-radius-control) !important;
  border-color: var(--ln-hairline) !important;
  background: var(--ln-surface-card) !important;
}

.mldb-attach-modal .mldb-attach-upload.ant-upload-wrapper .ant-upload-drag:hover {
  border-color: var(--ln-primary) !important;
}

.mldb-attach-modal .mldb-attach-upload-title {
  margin: 0 0 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ln-ink);
}

.mldb-attach-modal .mldb-attach-upload-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ln-muted);
  line-height: 1.5;
}

.mldb-import-template-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--ln-hairline);
  border-radius: var(--ln-radius-control);
  background: var(--ln-surface-muted, #f8fafc);
}

.mldb-import-template-text strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ln-ink);
  font-size: 0.875rem;
}

.mldb-import-template-text p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ln-muted);
  line-height: 1.5;
}

.mldb-import-template-btn {
  flex-shrink: 0;
  border-radius: var(--ln-radius-control) !important;
  font-weight: 600 !important;
}

.mldb-import-alert {
  margin-bottom: 12px !important;
  border-radius: var(--ln-radius-control) !important;
}

.mldb-import-upload.ant-upload-wrapper .ant-upload-drag {
  border-radius: var(--ln-radius-control) !important;
  border-color: var(--ln-hairline) !important;
  background: var(--ln-surface-card) !important;
}

.mldb-import-upload-title {
  margin: 0 0 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ln-ink);
}

.mldb-import-upload-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ln-muted);
}

.mldb-import-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--ln-hairline);
  border-radius: var(--ln-radius-control);
  background: var(--ln-surface-muted, #f8fafc);
}

.mldb-import-preview-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ln-ink);
  font-size: 0.8125rem;
}

.mldb-import-preview-stats {
  margin-bottom: 8px;
  font-size: 0.8125rem;
}

.mldb-import-preview-ok {
  color: #047857;
  font-weight: 600;
}

.mldb-import-preview-err {
  margin-left: 12px;
  color: #dc2626;
  font-weight: 600;
}

.mldb-import-error-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.75rem;
  color: #b91c1c;
  line-height: 1.6;
  max-height: 160px;
  overflow: auto;
}

.mldb-import-fail-actions {
  margin-bottom: 8px;
}

.mldb-import-fail-download {
  padding-left: 0 !important;
  min-height: 44px;
  font-weight: 600;
}

.mldb-import-preview-table {
  margin-top: 4px;
}

.mldb-import-preview-table .ant-table {
  font-size: 0.75rem;
}

.mldb-import-preview-row--error > td {
  background: #fef2f2 !important;
}

.mldb-import-preview-remark-ok {
  color: #047857;
  font-weight: 600;
}

.mldb-import-preview-remark-err {
  color: #b91c1c;
}

@media (prefers-reduced-motion: reduce) {
  .mldb-page .maint-action-icon-btn {
    transition: none;
  }
}
