/* 业务观测 · 仪表盘（用户 / 内置） */

.page-header--dash .page-header__title-row--tabs {
  border-bottom: none;
}

.status-tabs--page {
  width: 100%;
}

/* —— 工具栏 —— */
.biz-dash__toolbar {
  justify-content: space-between;
  border-bottom: 1px solid var(--obs-border);
}

.biz-dash__toolbar-left,
.biz-dash__toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.biz-dash__search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.biz-dash__search-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--obs-neutral-400);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.biz-dash__search .search-input {
  width: 280px;
  padding-left: 32px;
}

.biz-dash__filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-base);
  color: var(--obs-neutral-600);
}

.biz-dash__filter select {
  height: var(--control-height);
  min-width: 200px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--obs-border);
  border-radius: 2px;
  font-size: var(--font-size-base);
  font-family: inherit;
  color: var(--obs-neutral-400);
  background: var(--obs-bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
}

.biz-dash__refresh {
  min-width: var(--control-height);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* —— 用户仪表盘 · 表格 —— */
.biz-dash__table-wrap .data-table th,
.biz-dash__table-wrap .data-table td {
  height: calc(var(--table-row-height) * 1.2);
  min-height: calc(var(--table-row-height) * 1.2);
}

.biz-dash__table-wrap .data-table tbody td {
  vertical-align: middle;
}

.biz-dash__table-wrap .data-table tbody td:first-child {
  white-space: normal;
}

.biz-dash__name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  width: 100%;
  min-height: 0;
}

.biz-dash__thumb {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--biz-dash-thumb-bg, var(--obs-brand));
  color: var(--biz-dash-thumb-color, #fff);
  line-height: 1;
  border: none;
}

.biz-dash__thumb--brand {
  --biz-dash-thumb-bg: var(--obs-brand);
}

.biz-dash__thumb--warning {
  --biz-dash-thumb-bg: var(--obs-warning);
}

.biz-dash__thumb--pending {
  --biz-dash-thumb-bg: var(--obs-pending);
}

.biz-dash__thumb-glyph {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.biz-dash__name-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.biz-dash__name-link {
  flex-shrink: 0;
  max-width: 50%;
  color: var(--obs-neutral-900);
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biz-dash__name-link:hover {
  color: var(--obs-brand);
}

.biz-dash__tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.biz-dash__tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 20px;
  padding: 0 6px;
  border-radius: 2px;
  background: var(--obs-bg-tag-neutral);
  color: var(--obs-neutral-600);
  font-size: var(--font-size-xs);
  white-space: nowrap;
}

.biz-dash__tag-more {
  flex-shrink: 0;
  color: var(--obs-neutral-400);
  font-size: var(--font-size-xs);
  line-height: 20px;
}

.biz-dash__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.biz-dash__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--obs-brand);
  color: var(--obs-text-on-brand);
  font-size: var(--font-size-xs);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.data-table .col-actions--dash {
  width: 220px;
}

.biz-dash__row-actions {
  white-space: nowrap;
}

.biz-dash__row-actions .btn--text {
  padding: 0 6px;
}

.biz-dash__more {
  min-width: 24px;
  letter-spacing: 1px;
}

.table-footer__pager {
  display: flex;
  align-items: center;
  gap: 16px;
}

.table-footer__size select {
  height: 32px;
  padding: 0 28px 0 8px;
  border: 1px solid var(--obs-border);
  border-radius: 2px;
  font-size: var(--font-size-sm);
  font-family: inherit;
  color: var(--obs-neutral-600);
  background: var(--obs-bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 8px center;
  appearance: none;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* —— 内置仪表盘 · 卡片网格 —— */
.biz-dash-builtin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

@media (max-width: 1400px) {
  .biz-dash-builtin-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .biz-dash-builtin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .biz-dash-builtin-grid {
    grid-template-columns: 1fr;
  }
}

.biz-dash-builtin-card {
  display: flex;
  flex-direction: column;
  background: var(--obs-bg-card);
  border: 1px solid var(--obs-border);
  border-radius: 2px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.biz-dash-builtin-card:hover {
  border-color: var(--obs-brand);
}

.biz-dash-builtin-card__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 16px 12px;
}

.biz-dash-builtin-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.biz-dash-builtin-card__title {
  flex-shrink: 0;
  max-width: 50%;
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--obs-neutral-900);
  margin: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biz-dash-builtin-card__actions {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--obs-border);
  margin-top: auto;
}

.biz-dash-builtin-card__action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: var(--font-size-sm);
  color: var(--obs-neutral-600);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.biz-dash-builtin-card__action + .biz-dash-builtin-card__action {
  border-left: 1px solid var(--obs-border);
}

.biz-dash-builtin-card__action:hover {
  color: var(--obs-brand);
  background: var(--obs-sidebar-hover);
}

.biz-dash-builtin-card__action svg {
  flex-shrink: 0;
}

/* —— 新建仪表盘 —— */
.biz-dash-new__crumb {
  display: flex;
  align-items: center;
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--obs-neutral-900);
}

.biz-dash-new__crumb a {
  color: var(--obs-neutral-600);
  text-decoration: none;
  font-weight: 600;
}

.biz-dash-new__crumb a:hover {
  color: var(--obs-brand);
}

.biz-dash-new__crumb-sep {
  margin: 0 4px;
  color: var(--obs-neutral-400);
  font-weight: 400;
}

.biz-dash-new__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.biz-dash-new__action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 120px;
  padding: 24px 16px;
  border: 1px dashed var(--obs-border);
  border-radius: 2px;
  background: var(--obs-bg-card);
  color: var(--obs-neutral-600);
  font-size: var(--font-size-base);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.biz-dash-new__action-card:hover {
  border-color: var(--obs-brand);
  color: var(--obs-brand);
}

.biz-dash-new__action-icon {
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
}

.biz-dash-new__section-title {
  margin: 0 0 12px;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--obs-neutral-900);
}

.biz-dash-new__search {
  display: block;
  margin-bottom: 16px;
}

.biz-dash-new__search .search-input {
  width: 100%;
  max-width: 480px;
}

.biz-dash-new__template-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--obs-border);
  border-radius: 2px;
  background: var(--obs-bg-card);
  overflow: hidden;
}

.biz-dash-new__template-list > li + li {
  border-top: 1px solid var(--obs-border);
}

.biz-dash-new__template-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.biz-dash-new__template-row:hover {
  background: var(--obs-bg-table-row-hover);
}

.biz-dash-new__template-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.biz-dash-new__template-name {
  flex-shrink: 0;
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--obs-neutral-900);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .biz-dash-new__actions {
    grid-template-columns: 1fr;
  }
}

/* —— 仪表盘查看页（订单服务监控）—— */
.main--dash-view .content-panel.dashboard-view {
  padding: 16px;
  background: var(--obs-bg-page);
}

.biz-dash-view__head {
  justify-content: space-between;
  gap: 16px;
}

.biz-dash-view__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.biz-dash-view__date {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.biz-dash-view__date-input {
  width: 168px;
  height: var(--control-height);
  padding: 0 32px 0 12px;
  border: 1px solid var(--obs-border);
  border-radius: 2px;
  background: var(--obs-bg-card);
  font-family: inherit;
  font-size: var(--font-size-sm);
  color: var(--obs-neutral-900);
}

.biz-dash-view__date-input::placeholder {
  color: var(--obs-neutral-400);
}

.biz-dash-view__date-icon {
  position: absolute;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--obs-neutral-400);
  pointer-events: none;
}

.main--dash-view .dashboard-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.main--dash-view .dashboard-view-grid .panel--wide {
  grid-column: 1 / -1;
}

.biz-dash-view__panel {
  margin: 0;
}

.biz-dash-view__panel-title {
  margin: 0 0 12px;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--obs-neutral-900);
}

.main--dash-view .dashboard-view-grid .chart-placeholder {
  height: 180px;
  margin-top: 0;
}

.main--dash-view .dashboard-view-grid .chart-placeholder--table {
  height: 200px;
}

.main--dash-view .dashboard-view-grid .chart-placeholder--metric {
  font-size: 40px;
  font-weight: 600;
  color: var(--obs-brand);
}

@media (max-width: 768px) {
  .biz-dash-view__head {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .main--dash-view .dashboard-view-grid {
    grid-template-columns: 1fr;
  }
}
