/* ============================================================
   管理员列表页共享样式
   引入: AdminOrdersView, AdminTasksView, AdminMessageDeliveriesView,
         AdminWebhookEventsView, AdminUsersView, AdminInventoryView
   各页面自行覆盖 grid-template-columns 等布局差异
   ============================================================ */

/* ---------- 页面包裹 ---------- */
.list-page {
  display: grid;
  gap: 0;
}

/* ---------- 总量标签 ---------- */
.total-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(37, 89, 167, 0.14);
  border-radius: var(--radius-full);
  background: rgba(37, 89, 167, 0.08);
  color: #2559a7;
  font-size: var(--text-xs);
  font-weight: 700;
}

/* ---------- 卡片区域 ---------- */
.section-card {
  margin-top: var(--space-4);
}

/* ---------- 卡片头部 ---------- */
.card-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-end;
}

.card-title {
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: 600;
}

.card-desc {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ---------- 筛选网格 ---------- */
.filter-grid {
  display: grid;
  gap: var(--space-3);
  align-items: center;
}

.filter-control {
  width: 100%;
  min-width: 0;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  min-width: 156px;
  justify-content: flex-end;
}

/* ---------- 摘要条 ---------- */
.summary-strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 38px;
  padding: 0;
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.summary-title {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  margin-right: 2px;
}

.summary-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  color: var(--text-secondary);
  background: #f8fafc;
  font-size: var(--text-xs);
  font-weight: 700;
}

.summary-metric strong {
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1;
}

.summary-metric[data-tone="success"] {
  color: var(--color-success-dark);
  background: var(--color-success-light);
  border-color: #bbf7d0;
}
.summary-metric[data-tone="danger"] {
  color: var(--color-danger-dark);
  background: var(--color-danger-light);
  border-color: #fecaca;
}
.summary-metric[data-tone="primary"] {
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  border-color: #bfdbfe;
}
.summary-metric[data-tone="warning"] {
  color: var(--color-warning-dark);
  background: var(--color-warning-light);
  border-color: #fed7aa;
}
.summary-metric[data-tone="muted"] {
  color: var(--text-secondary);
  background: #f8fafc;
  border-color: var(--border-default);
}

/* ---------- 表格工具栏 ---------- */
.table-toolbar {
  margin-bottom: var(--space-3);
}

.table-toolbar strong {
  display: block;
  color: var(--text-primary);
  font-size: var(--text-base);
}

.table-toolbar span {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* ---------- el-table 统一主题变量 ---------- */
.data-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  --el-table-bg-color: transparent;
  --el-table-tr-bg-color: transparent;
  --el-table-header-bg-color: rgba(239, 246, 255, 0.72);
  --el-table-row-hover-bg-color: rgba(239, 246, 255, 0.72);
  --el-table-border-color: rgba(86, 108, 138, 0.1);
}

.data-table :deep(.el-table__inner-wrapper::before) {
  display: none;
}

.data-table :deep(th.el-table__cell) {
  height: 42px;
  background: var(--el-table-header-bg-color);
  color: var(--text-secondary);
  font-weight: 700;
}

/* ---------- 单元格通用 ---------- */
.cell-stack {
  display: grid;
  gap: 5px;
}

.cell-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.compact-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 240px;
  padding: 0 9px;
  border-radius: var(--radius-full);
  background: #f4f7fb;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
}

.compact-chip--muted {
  color: var(--text-muted);
}

.cell-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 700;
}

.cell-subline {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475467;
  font-size: var(--text-xs);
}

/* ---------- ID 链接 ---------- */
.id-link {
  display: inline-block;
  max-width: 100%;
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.id-link:hover {
  color: var(--color-primary-dark);
}

/* ---------- 详情链接按钮 ---------- */
.detail-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  font-size: var(--text-xs);
  font-weight: 700;
  text-decoration: none;
}

.detail-link:hover {
  border-color: var(--border-hover);
  background: #dbeafe;
}

/* ---------- 操作 & 状态容器 ---------- */
.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.action-stack--nowrap {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.action-stack--vertical {
  flex-direction: column;
  align-items: center;
}
.action-stack--tight {
  gap: var(--space-2);
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.status-stack :deep(.el-tag) {
  max-width: 100%;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .filter-buttons {
    width: 100%;
  }
  .filter-buttons :deep(.el-button) {
    flex: 1 1 auto;
  }
}
.mt-4 {
  margin-top: 16px;
}
