/* ============================================================
 * tabs.css — 多标签页导航
 * ============================================================ */

.tabbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 12px;
  height: 38px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { height: 0; }

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  height: 30px;
  border-radius: 7px 7px 0 0;
  font-size: 12px;
  color: var(--txt-3);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  transition: background .15s, color .15s;
  border: 1px solid transparent;
  border-bottom: none;
  user-select: none;
}
.tab:hover { background: var(--bg-3); color: var(--txt-2); }

.tab.active {
  background: var(--bg);
  color: var(--txt);
  border-color: var(--line);
  font-weight: 500;
}
.tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--acc);
  border-radius: 2px 2px 0 0;
}

.tab-icon { font-size: 11px; opacity: .8; }
.tab-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }

.tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
  color: var(--txt-3);
  opacity: .6;
  transition: .15s;
}
.tab-close:hover {
  background: rgba(239, 68, 68, .18);
  color: var(--red);
  opacity: 1;
}

.tab-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding-left: 10px;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
}
.tab-act {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--txt-3);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
}
.tab-act:hover { background: var(--bg-3); color: var(--txt); }

/* 内容区顶部留白（标签栏已分隔） */
.content { padding-top: 14px; }

/* 浅色 */
[data-theme="light"] .tab.active {
  background: #fff;
  box-shadow: 0 -1px 6px rgba(30, 50, 90, .05);
}

/* ============================================================
 * 图表容器
 * ============================================================ */
.chart-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.chart-title { font-size: 13px; font-weight: 650; }
.chart-sub { font-size: 11px; color: var(--txt-3); }
.chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 11px;
}
.chart-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--txt-3);
}
.chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

/* ============================================================
 * 开发者管理 · 权限范围选择
 * ============================================================ */
.scope-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 8px;
}
.scope-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  cursor: pointer;
  transition: .15s;
}
.scope-item:hover { border-color: var(--acc); }
.scope-item:has(input:checked) {
  border-color: var(--acc);
  background: rgba(59, 130, 246, .08);
}

/* 覆盖全局 .field input 的满宽样式 */
.scope-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  margin: 2px 0 0;
  flex: 0 0 14px;
  accent-color: var(--acc);
}

.scope-label { font-size: 12px; color: var(--txt); line-height: 1.4; }
.scope-key {
  font-size: 10px;
  color: var(--txt-3);
  margin-top: 2px;
  font-family: ui-monospace, monospace;
}

/* 表单里行内的小勾选：不换行、不撑宽 */
.inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--txt-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.inline-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  margin: 0;
  accent-color: var(--acc);
}
