/* ==================== 后台管理布局 ==================== */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}
.admin-sidebar {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  flex-shrink: 0;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.admin-nav-item:hover { background: var(--border-light); color: var(--text); }
.admin-nav-item.active { background: var(--primary-light); color: var(--primary); }
.admin-main {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
  max-height: calc(100vh - 60px);
}
.admin-page { display: none; }
.admin-page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0;
}
.page-title + .page-title { display: none; }

/* ==================== 统计卡片 ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==================== 仪表盘双栏 ==================== */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.dashboard-col h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}
.simple-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.simple-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.simple-list-item:last-child { border-bottom: none; }
.simple-list-item .item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.simple-list-item .item-meta {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ==================== 管理表格 ==================== */
.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* 操作按钮组 */
.btn-xs {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: var(--transition);
  margin-right: 4px;
}
.btn-xs:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-xs.danger:hover { border-color: var(--red); color: var(--red); background: #fef2f2; }

/* 角色标签 */
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.role-badge.admin { background: #fee2e2; color: #dc2626; }
.role-badge.user { background: #dbeafe; color: #2563eb; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-main { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-row { grid-template-columns: 1fr; }
}

/* ==================== 图标选择器 ==================== */
.icon-picker { position: relative; }
.icon-picker-selected {
  width: 100%; height: 42px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; cursor: pointer;
  border: 1px solid #e5e7eb; border-radius: 8px;
  background: #f9fafb; user-select: none;
  transition: .2s;
}
.icon-picker-selected:hover { border-color: var(--primary); background: var(--primary-light); }
.icon-picker-dropdown {
  display: none; position: absolute; top: 48px; left: 0; z-index: 1000;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  padding: 10px; width: 280px;
  grid-template-columns: repeat(8, 1fr); gap: 6px;
}
.icon-picker-dropdown.show { display: grid; }
.icon-picker-item {
  width: 30px; height: 30px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; transition: .15s;
}
.icon-picker-item:hover { background: var(--primary-light); transform: scale(1.2); }
.icon-picker-item.active { background: var(--primary); }
