/* Cards */
.mc-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color var(--transition-fast);
}
.mc-card:hover { border-color: var(--border-default); }

/* Section headings inside cards — use display font */
.mc-card h1, .mc-card h2, .mc-card h3, .mc-card h4 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.stat-number {
  font-size: 32px;
  font-weight: 600;
  color: var(--accent-primary);
  font-family: var(--font-ui);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Badges */
.badge {
  font-family: var(--font-ui);
  font-size: var(--font-size-xs);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
}
.badge-agent { background: rgba(91,141,238,0.2); color: #5b8dee; }
.badge-user  { background: rgba(153,153,153,0.15); color: var(--text-secondary); }
.badge-active { background: rgba(76,175,105,0.2); color: var(--color-success); }
.badge-paused { background: rgba(229,169,69,0.2); color: var(--color-warning); }
.badge-done   { background: rgba(124,110,255,0.2); color: var(--accent-hover); }
.badge-format { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border-default); }

/* Priority dot */
.priority-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.priority-dot.high   { background: var(--priority-high); }
.priority-dot.medium { background: var(--priority-medium); }
.priority-dot.low    { background: var(--priority-low); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.btn-sm { padding: 4px 10px; font-size: var(--font-size-xs); }
.btn-icon {
  width: 28px; height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-fast);
}
.btn-icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label { font-size: var(--font-size-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.form-input, .form-select, .form-textarea {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--font-size-sm);
  padding: 8px 10px;
  transition: border-color var(--transition-fast);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-border);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-select { cursor: pointer; }

/* Status dot */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.active   { background: var(--color-success); animation: pulse-green 2s infinite; }
.status-dot.idle     { background: var(--color-warning); }
.status-dot.offline  { background: var(--text-muted); }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,105,0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(76,175,105,0); }
}

/* Toast */
.mc-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--font-size-sm);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transform: translateY(8px);
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 300;
  max-width: 320px;
}
.mc-toast.visible { transform: translateY(0); opacity: 1; }
.mc-toast--success { border-left: 3px solid var(--color-success); }
.mc-toast--error   { border-left: 3px solid var(--color-danger); }
.mc-toast--info    { border-left: 3px solid var(--color-info); }

/* Activity feed */
.activity-feed { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border-default);
}
.activity-item.agent { border-left-color: var(--accent-primary); }
.activity-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-name { font-size: var(--font-size-xs); color: var(--accent-primary); font-weight: 600; }
.activity-msg  { font-size: var(--font-size-sm); color: var(--text-primary); }
.activity-time { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 2px; }

/* Two-column layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Progress bar */
.progress-wrap { background: var(--bg-tertiary); border-radius: 99px; height: 4px; overflow: hidden; margin-top: 8px; }
.progress-bar  { height: 100%; background: var(--accent-primary); border-radius: 99px; transition: width 0.4s ease; }
.progress-bar.progress-complete { background: var(--color-success); animation: progress-glow 2s ease-in-out 1; }
@keyframes progress-glow {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 8px 2px rgba(52, 211, 153, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Section header */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Filter tabs */
.filter-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.filter-tab {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-family: var(--font-ui);
  cursor: pointer;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.filter-tab:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.filter-tab.active { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--accent-hover); }

/* Markdown rendered content */
.mc-markdown { font-family: var(--font-body); font-size: var(--font-size-md); line-height: 1.7; color: var(--text-primary); }
.mc-markdown h1, .mc-markdown h2, .mc-markdown h3 { font-family: var(--font-ui); margin: 1.2em 0 0.5em; color: var(--text-primary); }
.mc-markdown h1 { font-size: 20px; }
.mc-markdown h2 { font-size: 16px; color: var(--text-secondary); }
.mc-markdown p { margin-bottom: 0.8em; }
.mc-markdown ul, .mc-markdown ol { padding-left: 20px; margin-bottom: 0.8em; }
.mc-markdown li { margin-bottom: 4px; }
.mc-markdown code { background: var(--bg-tertiary); padding: 1px 5px; border-radius: 3px; font-family: var(--font-ui); font-size: 0.9em; }
.mc-markdown pre { background: var(--bg-tertiary); padding: 12px; border-radius: var(--radius-md); margin-bottom: 1em; overflow-x: auto; }
.mc-markdown blockquote { border-left: 3px solid var(--accent-border); padding-left: 12px; color: var(--text-secondary); margin: 1em 0; }
.mc-markdown a { color: var(--accent-hover); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 32px; margin-bottom: 8px; }
.empty-state-text { font-size: var(--font-size-sm); }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border-subtle); margin: 16px 0; }

/* Close button */
.close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; line-height: 1;
  padding: 4px;
  transition: color var(--transition-fast);
}
.close-btn:hover { color: var(--text-primary); }
