/* ==========================================================================
   boards.css —— 单板台账（#/boards）专用样式
   作用域全部限定在 .boards-page 之内，不影响既有页面。
   颜色沿用 theme.css 的变量（--tone / --line / --text-muted），零外链、零字体依赖。
   ========================================================================== */

.boards-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- 概览 ---------- */

.boards-overview .stat-cards {
  margin-bottom: 0;
}

.boards-last-batch {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- 超管维护区 ---------- */

.boards-admin-card {
  margin-bottom: 0;
}

.boards-admin-card .tabs {
  margin-bottom: 12px;
}

.boards-admin-card .card-title {
  font-weight: 600;
}

/* ---------- ① 导入 ---------- */

.boards-import-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.boards-import-bar .field {
  flex: 1 1 420px;
  min-width: 280px;
}

.boards-import-bar .file-input {
  height: auto;
  padding: 8px;
}

/* 后端返回的中文错误必须显眼且完整可读 */
.boards-import-error {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
  border-radius: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.7;
}

.boards-import-error:empty {
  display: none;
}

.boards-error-title {
  font-weight: 600;
}

.boards-error-detail {
  color: #9a3412;
  font-size: 12px;
}

.boards-error-code {
  color: #9ca3af;
  font-size: 12px;
}

.boards-report {
  margin-top: 12px;
}

.boards-report-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boards-report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.boards-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.boards-metric-label {
  font-size: 12px;
  color: var(--text-muted);
}

.boards-metric-value {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: #111827;
}

.boards-report-head {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.boards-report-block {
  margin-bottom: 0;
  padding: 12px 14px;
  background: #fcfcfd;
}

.boards-report-block .card-title {
  font-size: 13px;
  margin-bottom: 8px;
}

/* ---------- 工具条（冲突 / 省份补录共用） ---------- */

.boards-toolbar {
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.boards-toolbar .input {
  width: 200px;
}

.boards-selected {
  font-size: 12px;
  color: #111827;
  padding: 2px 8px;
  background: #eef2ff;
  border-radius: 999px;
}

.boards-province-holder .select {
  width: 160px;
}

/* ---------- 网元省份：视图切换 / 行内编辑 / 重算预演 ---------- */

.boards-neprov-mode {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.boards-neprov-mode button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 12px;
  color: #4b5563;
  cursor: pointer;
  white-space: nowrap;
}

.boards-neprov-mode button + button {
  border-left: 1px solid var(--line);
}

.boards-neprov-mode button.is-active {
  background: #eef2ff;
  color: var(--tone);
  font-weight: 600;
}

.boards-neprov-summary {
  font-size: 12px;
  color: #6b7280;
  margin-left: auto;
  white-space: nowrap;
}

.boards-neprov-edit,
.boards-neprov-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.boards-neprov-edit .boards-neprov-picker {
  width: 118px;
}

/* 重算预演：变更样例，等宽显示网元名以便比对 */
.boards-reparse-sample {
  margin: 10px 0;
  padding: 8px 10px;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: 180px;
  overflow: auto;
}

.boards-reparse-line {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
  padding: 2px 0;
}

.boards-reparse-ne {
  flex: 1 1 auto;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
}

.boards-reparse-arrow {
  flex: 0 0 auto;
  color: var(--tone);
  font-weight: 600;
}

/* ---------- 冲突差异值 ---------- */

.boards-diff-fields {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.boards-diff-values {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.boards-diff-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.boards-diff-value {
  font-size: 12px;
  color: #111827;
  word-break: break-all;
}

.boards-diff-value.is-empty {
  color: #9ca3af;
}

/* ---------- 台账列表 ---------- */

.boards-filter .filter-bar {
  margin-bottom: 0;
}

.boards-filter .filter-bar .boards-keyword {
  width: 230px;
}

.boards-ne {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.boards-status {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* 行可点击进详情：用光标 + hover 提示，不加额外列 */
.boards-list .data-table tbody tr.is-clickable {
  cursor: pointer;
}

.boards-list .data-table tbody tr.is-clickable:hover {
  background: #f8fafc;
}

/* 详情弹窗：25 个字段两列以上排布，值可换行 */
.boards-detail .kv-value {
  word-break: break-all;
}

@media (max-width: 720px) {
  .boards-import-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .boards-filter .filter-bar .input,
  .boards-filter .filter-bar .select,
  .boards-filter .filter-bar .boards-keyword,
  .boards-toolbar .input {
    width: 100%;
  }
}
