/* ========================================
   管理后台专用样式
   ======================================== */

/* Admin Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #1a237e 0%, #283593 100%);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: width var(--transition-base);
}

.admin-sidebar.collapsed {
  width: 70px;
}

.admin-sidebar-logo {
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  min-height: 70px;
}

.admin-sidebar-logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.admin-sidebar-logo h2 {
  font-size: var(--font-size-md);
  color: white;
  margin: 0;
  white-space: nowrap;
}

.admin-sidebar-logo .logo-text-sub {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.6);
  margin: 0;
}

.admin-menu {
  list-style: none;
  padding: var(--spacing-md) 0;
  margin: 0;
}

.admin-menu-item {
  margin: 2px 0;
}

.admin-menu-link {
  display: flex;
  align-items: center;
  padding: 12px var(--spacing-lg);
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  font-size: var(--font-size-base);
}

.admin-menu-link:hover {
  background-color: rgba(255,255,255,0.08);
  color: white;
  text-decoration: none;
}

.admin-menu-link.active {
  background-color: rgba(255,255,255,0.12);
  color: white;
  border-left-color: var(--accent-orange);
}

.admin-menu-icon {
  width: 24px;
  height: 24px;
  margin-right: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-base);
}

.admin-sidebar.collapsed + .admin-main {
  margin-left: 70px;
}

/* Admin Topbar */
.admin-topbar {
  height: 60px;
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.admin-breadcrumb a {
  color: var(--text-muted);
}

.admin-breadcrumb .separator {
  margin: 0 4px;
}

.admin-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.admin-username {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-weight: 500;
}

/* Admin Content */
.admin-content {
  flex: 1;
  padding: var(--spacing-lg);
}

/* Dashboard Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card:nth-child(1)::after { background-color: var(--primary-blue); }
.stat-card:nth-child(2)::after { background-color: var(--primary-green); }
.stat-card:nth-child(3)::after { background-color: var(--accent-orange); }
.stat-card:nth-child(4)::after { background-color: #9c27b0; }

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-info h4 {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: var(--spacing-xs);
}

.stat-value {
  font-size: var(--font-size-xxxl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-change {
  font-size: var(--font-size-xs);
  margin-top: var(--spacing-xs);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon-blue { background-color: rgba(33,150,243,0.1); color: var(--primary-blue); }
.stat-icon-green { background-color: rgba(76,175,80,0.1); color: var(--primary-green); }
.stat-icon-orange { background-color: rgba(255,152,0,0.1); color: var(--accent-orange); }
.stat-icon-purple { background-color: rgba(156,39,176,0.1); color: #9c27b0; }

/* Dashboard Chart Area */
.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

/* CSS Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-md);
  height: 200px;
  padding: var(--spacing-md) 0;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 48px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 1s ease;
  position: relative;
  min-height: 4px;
}

.bar-blue { background: linear-gradient(180deg, var(--primary-blue), #64B5F6); }
.bar-green { background: linear-gradient(180deg, var(--primary-green), #81C784); }
.bar-orange { background: linear-gradient(180deg, var(--accent-orange), #FFB74D); }

.bar-label {
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
}

.bar-value {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

/* Donut Chart (CSS) */
.donut-chart {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  padding: var(--spacing-md) 0;
}

.donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: var(--bg-white);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-total {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  color: var(--text-primary);
}

.donut-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

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

.legend-value {
  font-weight: 600;
  color: var(--text-primary);
  margin-left: auto;
}

/* Service Package Cards */
.package-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
}

.package-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.package-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.package-card.featured {
  border-color: var(--primary-blue);
}

.package-header {
  padding: var(--spacing-xl) var(--spacing-lg);
  text-align: center;
  color: white;
}

.package-header.basic {
  background: linear-gradient(135deg, #43A047, #66BB6A);
}

.package-header.standard {
  background: linear-gradient(135deg, #1E88E5, #42A5F5);
}

.package-header.premium {
  background: linear-gradient(135deg, #F57C00, #FFA726);
}

.package-name {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.package-price {
  font-size: var(--font-size-xxxl);
  font-weight: 700;
}

.package-price .unit {
  font-size: var(--font-size-sm);
  font-weight: 400;
  opacity: 0.8;
}

.package-body {
  padding: var(--spacing-lg);
}

.package-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-lg) 0;
}

.package-features li {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--bg-light);
}

.package-features li:last-child {
  border-bottom: none;
}

.package-features .check {
  color: var(--success);
  margin-right: var(--spacing-sm);
  font-weight: bold;
}

.package-features .cross {
  color: var(--text-muted);
  margin-right: var(--spacing-sm);
}

.package-actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.filter-bar .search-input {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  position: relative;
}

.filter-bar .search-input input {
  width: 100%;
  padding-left: 36px;
}

.filter-bar .search-input::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-sm);
  z-index: 1;
}

.filter-select {
  min-width: 140px;
}

/* Action Buttons in Tables */
.table-actions {
  display: flex;
  gap: var(--spacing-xs);
}

.table-actions .btn {
  padding: 4px 8px;
  font-size: var(--font-size-xs);
}

/* Kanban Counter Animation */
.counter-animate {
  display: inline-block;
  transition: all var(--transition-base);
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: var(--spacing-lg);
  gap: 0;
}

.tab-item {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  user-select: none;
}

.tab-item:hover {
  color: var(--primary-blue);
}

.tab-item.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
  font-weight: 500;
}

/* Form Inline */
.form-inline {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.form-inline .form-group {
  margin-bottom: 0;
}

/* Detail Panel */
.detail-panel {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
}

.detail-row {
  display: flex;
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--bg-light);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  width: 120px;
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.detail-value {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
  
  .package-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  
  .admin-sidebar.active {
    transform: translateX(0);
  }
  
  .admin-main {
    margin-left: 0 !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .package-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-bar .search-input {
    max-width: 100%;
  }
  
  .donut-chart {
    flex-direction: column;
    align-items: center;
  }
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
  padding: var(--spacing-sm);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ========================================
   Phase 4 Week 3 - 新模块样式
   ======================================== */

/* 进度条通用 */
.score-bar {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.score-bar-fill.green { background: linear-gradient(90deg, #4CAF50, #66BB6A); }
.score-bar-fill.yellow { background: linear-gradient(90deg, #FF9800, #FFB74D); }
.score-bar-fill.red { background: linear-gradient(90deg, #F44336, #EF5350); }
.score-bar-fill.blue { background: linear-gradient(90deg, #2196F3, #42A5F5); }

/* 分数标签 */
.score-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.score-tag.green { background: #E8F5E9; color: #2E7D32; }
.score-tag.yellow { background: #FFF3E0; color: #E65100; }
.score-tag.red { background: #FFEBEE; color: #C62828; }

/* 分类标签 */
.cat-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.cat-tag.diet { background: #E8F5E9; color: #2E7D32; }
.cat-tag.exercise { background: #E3F2FD; color: #1565C0; }
.cat-tag.medication { background: #FFF3E0; color: #E65100; }
.cat-tag.symptom { background: #FFEBEE; color: #C62828; }
.cat-tag.other { background: #F5F5F5; color: #616161; }

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.status-tag.pending { background: #FFF3E0; color: #E65100; }
.status-tag.ai_answered { background: #E3F2FD; color: #1565C0; }
.status-tag.waiting_doctor { background: #FCE4EC; color: #C2185B; }
.status-tag.doctor_replied { background: #E8F5E9; color: #2E7D32; }
.status-tag.closed { background: #F5F5F5; color: #616161; }

/* 表格行警告 */
tr.row-warning { background: #FFFDE7 !important; }
tr.row-danger { background: #FFEBEE !important; }

/* Tab内容区域 */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* 复选框列 */
.checkbox-cell { width: 40px; text-align: center; }
.checkbox-cell input { cursor: pointer; }

/* 批量操作栏 */
.batch-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #E3F2FD;
  border-radius: 8px;
  margin-bottom: 12px;
}
.batch-bar.active { display: flex; }
.batch-bar .selected-count { font-size: 13px; color: #1565C0; font-weight: 500; }

/* 咨询对话气泡 */
.chat-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 10px;
  max-width: 85%;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.user {
  background: #E3F2FD;
  color: #1565C0;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.chat-bubble.ai {
  background: #F3E5F5;
  color: #6A1B9A;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}
.chat-bubble.doctor {
  background: #E8F5E9;
  color: #2E7D32;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}
.chat-meta {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

/* 星级评分 */
.star-rating { display: inline-flex; gap: 4px; cursor: pointer; }
.star-rating .star {
  font-size: 20px;
  color: #ddd;
  transition: color 0.15s, transform 0.15s;
}
.star-rating .star.active,
.star-rating .star.hover { color: #FFC107; }
.star-rating .star:hover { transform: scale(1.15); }
.star-display { color: #FFC107; font-size: 14px; }

/* 看板新增模块 */
.dashboard-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}
.mini-stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.mini-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}
.mini-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 医生排名行 */
.doctor-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-light);
}
.doctor-rank-row:last-child { border-bottom: none; }
.doctor-rank-name { width: 80px; font-size: 13px; font-weight: 500; flex-shrink: 0; }
.doctor-rank-bar { flex: 1; }
.doctor-rank-score { width: 50px; text-align: right; font-size: 14px; font-weight: 600; }

/* 响应式补充 */
@media (max-width: 1024px) {
  .dashboard-mini-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dashboard-mini-grid { grid-template-columns: 1fr; }
  .chat-bubble { max-width: 95%; }
}

/* ========================================
   菜单分组折叠样式 (Phase4 Week3+)
   ======================================== */
.menu-group {
  margin-bottom: 4px;
}

.menu-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 6px;
  cursor: pointer;
  user-select: none;
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.menu-group-header:hover {
  color: rgba(255,255,255,0.7);
}

.menu-group-header .menu-group-arrow {
  font-size: 10px;
  transition: transform 0.25s ease;
}

.menu-group.collapsed .menu-group-arrow {
  transform: rotate(-90deg);
}

.menu-group-items {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.3s ease;
}

.menu-group.collapsed .menu-group-items {
  max-height: 0;
}

/* 独立菜单项（看板等不分组的） */
.admin-menu > .admin-menu-item.solo {
  margin-bottom: 4px;
}

/* 分组内菜单项缩进略小 */
.menu-group-items .admin-menu-link {
  padding-left: 48px;
  font-size: 13.5px;
}

.menu-group-items .admin-menu-icon {
  width: 20px;
  height: 20px;
  font-size: 15px;
  margin-right: 10px;
}

/* 当前活跃分组自动展开 */
.menu-group.has-active .menu-group-header {
  color: rgba(255,255,255,0.65);
}

/* ========================================
   Phase 5 Week 1 新增样式
   ======================================== */

/* 驾驶舱布局 */
.cockpit-grid .stats-grid {
  grid-template-columns: repeat(5, 1fr);
}

/* 待办事项列表 */
.todo-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-light);
  border-radius: var(--radius-base);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}
.todo-item:hover {
  background: #fff;
  border-color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.12);
  text-decoration: none;
}
.todo-icon {
  font-size: 20px;
}
.todo-label {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}
.todo-badge {
  min-width: 32px;
  height: 24px;
  line-height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  background: #e0e0e0;
  color: #999;
}
.todo-badge.active {
  background: var(--primary-blue);
  color: #fff;
}
.todo-item.danger .todo-badge,
.todo-badge.danger {
  background: var(--danger);
  color: #fff;
}
.todo-item.warn .todo-badge,
.todo-badge.warn {
  background: var(--warning);
  color: #fff;
}

/* 趋势图 */
.trend-chart-wrap {
  width: 100%;
  overflow-x: auto;
}
.trend-chart {
  display: block;
  min-width: 480px;
}
.trend-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* 预警列表 */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.alert-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-light);
  border-radius: var(--radius-base);
  border-left: 4px solid var(--warning);
}
.alert-item.severity-warning {
  border-left-color: var(--warning);
  background: #fff8e1;
}
.alert-item.severity-danger {
  border-left-color: var(--danger);
  background: #ffebee;
}
.alert-item.severity-critical {
  border-left-color: #b71c1c;
  background: #ffcdd2;
}
.alert-body {
  flex: 1;
}
.alert-title {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}
.alert-user {
  font-weight: 600;
  color: var(--primary-blue);
  text-decoration: none;
}
.alert-user:hover {
  text-decoration: underline;
}
.alert-content {
  font-size: 14px;
  color: var(--text-primary);
}
.alert-date {
  margin-top: 4px;
}

/* 用户画像页 */
.user-profile-page .section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text-primary);
}
.page-header-with-back {
  margin-bottom: 16px;
}
.user-profile-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  flex-wrap: wrap;
}
.uph-left {
  display: flex;
  gap: 18px;
  flex: 1;
  min-width: 280px;
}
.uph-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-green));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  flex-shrink: 0;
}
.uph-info h3 {
  margin: 0 0 8px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.uph-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.uph-contract, .uph-doctor {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.uph-right {
  display: flex;
  gap: 24px;
}
.uph-score-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.uph-score-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* 体征网格 */
.vital-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.vital-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-base);
  padding: 16px;
  transition: all var(--transition-fast);
}
.vital-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.vital-card.abnormal {
  border-color: var(--danger);
  background: #fff5f5;
}
.vital-card.abnormal .vital-value {
  color: var(--danger);
}
.vital-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.vital-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.vital-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
.vital-date {
  margin-top: 6px;
}

/* 两列布局 */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.two-col-grid .col-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.two-col-grid .col-right {
  display: flex;
}

/* 时间线 */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border-color);
}
.timeline-item {
  position: relative;
  padding-bottom: 16px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.timeline-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.timeline-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.timeline-date {
  font-size: 12px;
}

/* 服务余量 */
.usage-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}
.usage-row:last-child {
  border-bottom: none;
}
.usage-name {
  font-weight: 600;
  margin-bottom: 6px;
}
.usage-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.usage-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* 空状态（inline） */
.empty-state-inline {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

/* 生活方式方案条目 */
.lifestyle-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}
.lifestyle-item:last-child {
  border-bottom: none;
}
.lifestyle-title {
  font-weight: 600;
  margin-bottom: 6px;
}
.lifestyle-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* 体征趋势图 */
.vital-chart {
  width: 100%;
}
.vital-chart-legend {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* 医生表格 */
.doctor-table {
  font-size: 13px;
}
.load-bar.progress {
  height: 8px;
  background: #eee;
}

/* 进度条颜色变体 */
.progress-bar.green { background: var(--success); }
.progress-bar.yellow { background: var(--warning); }
.progress-bar.red { background: var(--danger); }

/* Tab 切换 */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
  gap: 4px;
  overflow-x: auto;
}
.tab-item {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.tab-item:hover {
  color: var(--primary-blue);
}
.tab-item.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
  font-weight: 600;
}

/* RBAC 左右分栏 */
.rbac-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}
.rbac-left .card-header,
.rbac-right .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  margin-bottom: 6px;
}
.role-item:hover {
  background: var(--bg-light);
}
.role-item.active {
  background: #e3f2fd;
  border-color: var(--primary-blue);
}
.role-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-desc {
  font-size: 12px;
  margin-top: 4px;
}
.btn-icon-only {
  padding: 4px 8px;
}

.perm-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.permission-group {
  margin-bottom: 18px;
}
.permission-group-title {
  font-size: 14px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-color);
}
.permission-group-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.permission-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.permission-item:hover {
  background: var(--bg-light);
}
.permission-item input[type="checkbox"] {
  margin-top: 3px;
}
.perm-name {
  font-weight: 500;
}
.perm-desc {
  display: block;
  margin-top: 2px;
  line-height: 1.4;
}

/* 用户角色badge */
.user-role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
}
.role-remove-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.7;
}
.role-remove-btn:hover {
  opacity: 1;
}

/* 响应式适配 */
@media (max-width: 1200px) {
  .cockpit-grid .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .vital-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .todo-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .cockpit-grid .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .vital-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .todo-list {
    grid-template-columns: 1fr;
  }
  .two-col-grid {
    grid-template-columns: 1fr;
  }
  .user-profile-header {
    flex-direction: column;
  }
  .uph-right {
    width: 100%;
    justify-content: space-around;
  }
  .rbac-layout {
    grid-template-columns: 1fr;
  }
  .permission-group-items {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .cockpit-grid .stats-grid {
    grid-template-columns: 1fr;
  }
  .vital-grid {
    grid-template-columns: 1fr;
  }
}
