.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-color-start) 0%, var(--stat-color-end) 100%);
}

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

.stat-card.live { --stat-color-start: #ef4444; --stat-color-end: #f97316; }
.stat-card.room { --stat-color-start: #3b82f6; --stat-color-end: #8b5cf6; }
.stat-card.terminal { --stat-color-start: #06b6d4; --stat-color-end: #10b981; }
.stat-card.task { --stat-color-start: #f59e0b; --stat-color-end: #ef4444; }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.stat-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
}

.stat-icon.live {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.stat-icon.live svg { fill: white; }

.stat-icon.room {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.stat-icon.room svg { fill: white; }

.stat-icon.terminal {
  background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}
.stat-icon.terminal svg { fill: white; }

.stat-icon.task {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.stat-icon.task svg { fill: white; }

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.stat-trend.up {
  background: var(--color-accent-success-light);
  color: var(--color-accent-success-dark);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-tertiary);
  font-weight: 500;
  margin-top: 6px;
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.room-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--room-status-color);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.room-item:hover {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: var(--color-accent-primary);
  box-shadow: var(--shadow-md);
}

.room-item:hover::before {
  opacity: 1;
}

.room-item.live { --room-status-color: #ef4444; }
.room-item.offline { --room-status-color: #94a3b8; }
.room-item.paused { --room-status-color: #f59e0b; }

.room-status-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.room-status-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 50%);
}

.room-status-icon svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
}

.room-status-icon.live {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}
.room-status-icon.live svg { fill: white; }

.room-status-icon.offline {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  box-shadow: 0 3px 10px rgba(148, 163, 184, 0.2);
}
.room-status-icon.offline svg { fill: white; }

.room-status-icon.paused {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}
.room-status-icon.paused svg { fill: white; }

.room-info {
  flex: 1;
  min-width: 0;
}

.room-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.room-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.room-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.room-meta-item svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0.7;
}

.room-terminals {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.terminal-tag {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}

.terminal-tag.obs {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

.terminal-tag.live {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
}

.terminal-tag.baiying {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.2);
}

.terminal-tag.inactive {
  opacity: 0.35;
}

.room-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.variables-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.variable-item {
  background: linear-gradient(180deg, #fafbfc 0%, #f1f5f9 100%);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: all var(--transition-fast);
}

.variable-item:hover {
  border-color: var(--color-accent-primary);
  box-shadow: var(--shadow-sm);
}

.variable-key {
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.variable-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.variable-input:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
}

.empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.empty-icon svg {
  width: 36px;
  height: 36px;
  fill: #64748b;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-bottom: 24px;
}

@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .variables-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .variables-grid {
    grid-template-columns: 1fr;
  }
}
