/* ============================================
   Skill Platform - Modern SaaS Design System
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #7c3aed;
  --bg-main: #f7f7f8;
  --bg-card: #ffffff;
  --surface-hover: #f2f2f4;
  --text-primary: #1a1a1c;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 18px 42px rgba(17,24,39,0.10);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-main);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-primary);
  line-height: 1.6;
}

#root { min-height: 100vh; }

.ant-layout { min-height: 100vh; background: var(--bg-main); }

.ant-btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  height: 36px !important;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
}
.ant-btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af) !important; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important; transform: translateY(-1px); }
.ant-btn-primary:active { transform: translateY(0); }
.ant-btn-default { border-radius: var(--radius-sm) !important; height: 36px !important; border-color: var(--border-color) !important; }
.ant-btn-default:hover { border-color: var(--primary) !important; color: var(--primary) !important; }

.ant-card { border-radius: var(--radius) !important; box-shadow: var(--shadow-sm) !important; border: none !important; }
.ant-card:hover { box-shadow: var(--shadow-md) !important; }
.ant-card-head { border-bottom: 1px solid var(--border-color); padding: 16px 24px; }
.ant-card-head-title { font-weight: 600; color: var(--text-primary); }
.ant-card-body { padding: 24px; }

.ant-table { background: var(--bg-card); border-radius: var(--radius-sm); }
.ant-table-thead > tr > th { background: #f8fafc !important; color: var(--text-secondary) !important; font-weight: 600 !important; border-bottom: 1px solid var(--border-color) !important; padding: 14px 16px !important; }
.ant-table-tbody > tr > td { border-bottom: 1px solid var(--border-color) !important; padding: 14px 16px !important; }
.ant-table-tbody > tr:hover > td { background: #f0f7ff !important; }
.ant-table-tbody > tr:last-child > td { border-bottom: none !important; }
.ant-table-cell a { color: var(--primary); margin-right: 8px; }
.ant-table-cell a:last-child { margin-right: 0; }
.ant-table-cell a:hover { color: var(--primary-dark); }

.ant-menu { background: transparent !important; }
.ant-menu-light .ant-menu-item { margin: 4px 8px !important; border-radius: var(--radius-sm) !important; color: var(--text-secondary); }
.ant-menu-light .ant-menu-item:hover { background: var(--surface-hover) !important; color: var(--text-primary) !important; }
.ant-menu-light .ant-menu-item-selected { background: var(--primary-light) !important; color: var(--primary) !important; font-weight: 600; position: relative; }
.ant-menu-light .ant-menu-item-selected::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: var(--primary); border-radius: 0 3px 3px 0; }

.ant-tag { border-radius: var(--radius-xs) !important; border: none !important; padding: 2px 10px !important; font-weight: 500; }
.ant-tag-blue { background: rgba(37, 99, 235, 0.1) !important; color: var(--primary) !important; }
.ant-tag-green { background: rgba(16, 185, 129, 0.1) !important; color: var(--accent-green) !important; }
.ant-tag-red { background: rgba(239, 68, 68, 0.1) !important; color: var(--accent-red) !important; }
.ant-tag-orange { background: rgba(245, 158, 11, 0.1) !important; color: var(--accent-amber) !important; }
.ant-tag-purple { background: rgba(139, 92, 246, 0.1) !important; color: var(--accent-purple) !important; }

.ant-input, .ant-input-affix-wrapper, .ant-select-selector { border-radius: var(--radius-sm) !important; border-color: var(--border-color) !important; }
.ant-input:hover, .ant-input-affix-wrapper:hover, .ant-select-selector:hover { border-color: var(--primary) !important; }
.ant-input:focus, .ant-input-affix-wrapper:focus, .ant-input-affix-wrapper-focused { border-color: var(--primary) !important; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1) !important; }

.ant-modal-content { border-radius: var(--radius) !important; overflow: hidden; }
.ant-modal-header { border-bottom: 1px solid var(--border-color); padding: 20px 24px; }
.ant-modal-title { font-weight: 600; font-size: 18px; }
.ant-drawer-content { border-radius: var(--radius) 0 0 var(--radius); }

.ant-tree .ant-tree-node-content-wrapper { padding: 4px 8px; border-radius: var(--radius-xs); }
.ant-tree .ant-tree-node-selected { background-color: rgba(37, 99, 235, 0.1) !important; }

.sider-logo { height: 64px; display: flex; align-items: center; justify-content: center; padding: 0 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.sider-logo-text { color: #fff; font-size: 16px; font-weight: 600; margin-left: 12px; white-space: nowrap; }
.sider-tagline { color: rgba(255, 255, 255, 0.5); font-size: 11px; margin-top: 2px; }
.menu-group-title { color: rgba(255, 255, 255, 0.4); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; padding: 16px 24px 8px; margin-top: 8px; }
.page-content { padding: 24px; background: var(--bg-card); border-radius: var(--radius); min-height: calc(100vh - 64px - 48px); }
.page-header { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.page-header-title { font-size: 28px; font-weight: 700; color: var(--text-primary); margin: 0; line-height: 1.3; }
.page-header-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.stat-card {}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .ant-statistic-title { font-size: 14px; color: var(--text-secondary); }
.stat-card .ant-statistic-content { font-size: 28px; font-weight: 600; color: var(--text-primary); }

code { background: #f1f5f9; padding: 2px 8px; border-radius: var(--radius-xs); font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13px; color: var(--primary); }
.filter-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-result-item { padding: 16px; border-bottom: 1px solid var(--border-color); }
.search-result-item:hover { background: #f8fafc; }
.search-result-item:last-child { border-bottom: none; }

.hot-rank-number { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; }
.hot-rank-number.top3 { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.hot-rank-number.normal { background: var(--text-muted); }

.platform-shell {
  min-height: 100vh;
  background: var(--bg-main);
}

.platform-sidebar {
  border-right: 1px solid var(--border-color);
  box-shadow: 2px 0 18px rgba(17, 24, 39, 0.03);
}

.platform-brand {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.platform-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.workbench-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.agent-workbench {
  height: 100%;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.agent-workbench-fullscreen {
  width: 100vw;
  height: 100vh;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #f8fafc;
}

.agent-chat-topbar {
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.agent-chat-topbar-left {
  min-width: 0;
}

.agent-plaza-button {
  height: 32px;
  border-radius: 8px;
  font-weight: 650;
}

.agent-topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.agent-topbar-title {
  min-width: 0;
  max-width: 320px;
}

.agent-thread-chip {
  color: var(--text-muted);
  display: block;
  font-size: 10.5px;
  line-height: 1.15;
  cursor: pointer;
}

.agent-chat-body {
  --chat-sidebar-width: 248px;
  position: relative;
}

.agent-chat-sidebar {
  width: var(--chat-sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  transition: width 0.18s ease, border-color 0.18s ease;
}

.agent-chat-sidebar.is-collapsed {
  width: 0;
  border-right-color: transparent;
}

.agent-chat-sidebar-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-sidebar-plaza {
  font-weight: 650;
}

.agent-chat-list {
  flex: 1;
  overflow: auto;
  padding: 6px;
}

.agent-chat-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin: 1px 0;
  border-left: 2px solid transparent;
}

.agent-chat-item:hover {
  background: var(--surface-hover);
}

.agent-chat-item.active {
  background: #eaf2ff;
  border-left-color: var(--primary);
}

.agent-chat-item-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.agent-chat-item-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 1px;
}

.agent-chat-sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-chat-sidebar-toggle {
  position: absolute;
  z-index: 12;
  top: 16px;
  left: var(--chat-sidebar-width);
  width: 18px;
  height: 34px;
  padding: 0;
  transform: translateX(-50%);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  color: #94a3b8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  opacity: 0.82;
  transition: left 0.18s ease, transform 0.18s ease, color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.agent-chat-sidebar-toggle .anticon {
  font-size: 9px;
}

.agent-chat-sidebar-toggle:hover {
  color: #64748b;
  background: #fff;
  opacity: 1;
}

.agent-chat-sidebar-toggle.is-collapsed {
  left: 6px;
  width: 20px;
  height: 30px;
  transform: translateX(0);
  border-radius: 8px;
}

.agent-chat-sidebar-footer-clickable {
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.agent-chat-sidebar-footer-clickable:hover {
  background: #f8fafc;
  box-shadow: inset 3px 0 0 var(--primary-light);
}

.personal-context-tabs .ant-tabs-nav {
  margin: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-color);
}

.personal-context-tabs .ant-tabs-content-holder {
  min-height: calc(100vh - 112px);
  background: #f8fafc;
}

.personal-context-pane {
  padding: 18px;
}

.personal-context-note {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.6;
}

.personal-context-empty {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
}

.personal-context-empty .anticon {
  font-size: 34px;
  color: var(--primary);
}

.personal-context-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.personal-context-row {
  width: 100%;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.personal-context-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.personal-mcp-market {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.personal-mcp-card {
  min-height: 84px;
  padding: 11px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.personal-mcp-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.personal-mcp-card .ant-typography:last-child {
  font-size: 12px;
  line-height: 1.45;
}

.personal-memory-head {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.automation-shell {
  min-height: 100%;
  padding: 22px;
  background: #f6f8fb;
}

.automation-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.automation-hero-main,
.automation-health,
.automation-list-panel,
.automation-detail-panel {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.automation-hero-main {
  min-width: 0;
  padding: 22px;
}

.automation-title.ant-typography {
  margin: 4px 0 8px;
  color: var(--text-primary);
}

.automation-subtitle.ant-typography {
  max-width: 780px;
  margin: 0 0 16px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.automation-reference-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.automation-reference {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.automation-reference > span {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #eff6ff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.automation-reference strong,
.automation-reference em,
.automation-metric strong,
.automation-metric em {
  display: block;
  font-style: normal;
}

.automation-reference strong {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.2;
}

.automation-reference em {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.automation-health {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.automation-health .ant-typography:last-child {
  max-width: 150px;
  font-size: 12px;
  line-height: 1.5;
}

.automation-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.automation-metric {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.automation-metric > span {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.automation-metric strong {
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.1;
}

.automation-metric em {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.automation-metric.tone-blue > span { background: #eff6ff; color: #2563eb; }
.automation-metric.tone-green > span { background: #ecfdf5; color: #059669; }
.automation-metric.tone-amber > span { background: #fffbeb; color: #d97706; }
.automation-metric.tone-red > span { background: #fef2f2; color: #dc2626; }

.automation-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.automation-list-panel,
.automation-detail-panel {
  min-width: 0;
  padding: 16px;
}

.automation-toolbar,
.automation-detail-head,
.automation-task-head,
.automation-task-meta,
.automation-trigger-band,
.automation-run-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.automation-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.automation-toolbar h2,
.automation-detail-head h3 {
  margin: 2px 0;
  color: var(--text-primary);
  letter-spacing: 0;
}

.automation-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.automation-task-card {
  width: 100%;
  min-height: 176px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.automation-task-card:hover,
.automation-task-card.selected {
  border-color: var(--primary);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.automation-task-card.selected {
  box-shadow: inset 3px 0 0 var(--primary), 0 12px 26px rgba(37, 99, 235, 0.08);
}

.automation-task-head {
  min-width: 0;
}

.automation-task-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.automation-task-card.tone-time .automation-task-icon { background: #eff6ff; color: #2563eb; }
.automation-task-card.tone-event .automation-task-icon { background: #ecfdf5; color: #059669; }
.automation-task-card.tone-flow .automation-task-icon { background: #fffbeb; color: #d97706; }

.automation-task-title {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 750;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.automation-task-card p {
  min-height: 48px;
  margin: 12px 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.automation-task-meta {
  flex-wrap: wrap;
}

.automation-detail-head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.automation-trigger-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.automation-trigger-band > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
}

.automation-trigger-band span {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-row: span 2;
}

.automation-trigger-band strong,
.automation-trigger-band em {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: normal;
}

.automation-trigger-band strong {
  color: var(--text-primary);
  font-size: 13px;
}

.automation-trigger-band em {
  color: var(--text-secondary);
  font-size: 12px;
}

.automation-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.automation-section-title {
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 750;
}

.automation-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.automation-flow span {
  max-width: 168px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.automation-flow i {
  width: 18px;
  height: 1px;
  background: #cbd5e1;
}

.automation-prompt {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.automation-no-runs {
  min-height: 120px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.automation-no-runs .anticon {
  color: var(--primary);
  font-size: 24px;
}

.automation-run-row {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.automation-run-row p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.automation-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
}

.agent-message-panel {
  background: var(--bg-card);
  flex: 1 1 auto;
}

.agent-message-scroll {
  background: #fff !important;
}

.user-message-plain {
  letter-spacing: 0;
}

.user-message-plain .ant-typography,
.user-message-plain p {
  margin-bottom: 0 !important;
  color: #111827 !important;
}

.user-message-plain code {
  color: #111827;
  background: transparent;
  padding: 0;
}

.artifact-compact-card {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.artifact-compact-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.artifact-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.artifact-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  flex-shrink: 0;
}

.skill-hub-shell,
.agent-dashboard-shell {
  padding: 24px;
}

.agent-dashboard-shell {
  min-height: calc(100vh - 88px);
  color: var(--text-primary);
}

.agent-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  margin-bottom: 16px;
}

.agent-dashboard-hero-main,
.agent-dashboard-live,
.metric-tile,
.agent-market-workbench,
.side-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.agent-dashboard-hero-main {
  position: relative;
  min-height: 214px;
  padding: 28px;
  overflow: hidden;
}

.agent-dashboard-hero-main::after {
  content: '';
  position: absolute;
  right: -120px;
  top: -150px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 50%;
}

.dashboard-eyebrow,
.section-kicker {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-title.ant-typography {
  margin: 8px 0 10px;
  color: var(--text-primary);
  letter-spacing: 0;
}

.dashboard-subtitle.ant-typography {
  max-width: 720px;
  margin-bottom: 22px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.dashboard-hero-actions {
  position: relative;
  z-index: 1;
}

.agent-dashboard-live {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.live-header,
.side-panel-header,
.agent-op-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-header {
  color: var(--text-primary);
  font-weight: 700;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.live-grid > div {
  padding: 12px 10px;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.live-grid strong {
  display: block;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.1;
}

.live-grid span,
.live-note,
.metric-label,
.agent-op-model,
.agent-op-desc,
.agent-op-progress span,
.prompt-preview p,
.blueprint-body span {
  color: var(--text-secondary);
}

.live-note {
  padding: 12px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.65;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-tile {
  min-height: 92px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-icon,
.blueprint-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.metric-value {
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 750;
  line-height: 1.1;
}

.metric-label {
  margin-top: 2px;
  font-size: 12px;
}

.tone-blue .metric-icon,
.tone-blue .blueprint-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.tone-green .metric-icon,
.tone-green .blueprint-icon {
  background: #dcfce7;
  color: #15803d;
}

.tone-amber .metric-icon,
.tone-amber .blueprint-icon {
  background: #fef3c7;
  color: #b45309;
}

.tone-violet .metric-icon,
.tone-violet .blueprint-icon {
  background: #ede9fe;
  color: #6d28d9;
}

.agent-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.agent-market-workbench {
  min-width: 0;
  padding: 18px;
}

.dashboard-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: -4px 0 18px;
  padding: 4px;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-admin-tabs button {
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.dashboard-admin-tabs button:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.dashboard-admin-tabs button.active {
  background: var(--primary-light);
  color: var(--primary);
}

.workbench-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-content: stretch;
  gap: 12px;
  margin-bottom: 18px;
}

.workbench-toolbar > div:first-child {
  min-width: 0;
  max-width: 100%;
}

.workbench-toolbar .ant-typography {
  word-break: normal;
  overflow-wrap: normal;
}

.workbench-toolbar h2,
.side-panel-header h3 {
  margin: 3px 0 4px;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.25;
}

.toolbar-controls {
  min-width: 0;
  width: 100%;
  max-width: 620px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-loading,
.dashboard-empty {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-empty {
  flex-direction: column;
  gap: 16px;
}

.agent-op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.agent-op-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.agent-op-card:hover,
.agent-op-card.selected {
  border-color: var(--accent-border, #bfdbfe);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.agent-op-card.selected {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.agent-op-avatar.ant-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
}

.agent-op-title {
  flex: 1;
  min-width: 0;
}

.agent-op-name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-op-model {
  margin-top: 2px;
  font-size: 12px;
}

.agent-op-desc.ant-typography {
  min-height: 42px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.55;
}

.agent-op-signal,
.agent-op-progress,
.capability-stack > div {
  display: flex;
  align-items: center;
}

.agent-op-signal {
  gap: 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.agent-op-signal span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.agent-op-signal .liked {
  color: var(--accent-red);
}

.agent-op-progress {
  gap: 10px;
  margin: 12px 0;
}

.agent-op-progress .ant-progress {
  flex: 1;
  min-width: 0;
}

.agent-op-progress span {
  flex-shrink: 0;
  font-size: 11px;
}

.agent-op-tags {
  min-height: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.agent-op-actions {
  display: grid;
  grid-template-columns: 1fr 36px 36px;
  gap: 8px;
  margin-top: 12px;
}

.agent-op-actions .ant-btn {
  min-width: 0;
}

.agent-side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 72px;
}

.side-panel-card {
  padding: 18px;
}

.side-panel-header {
  align-items: flex-start;
  margin-bottom: 16px;
}

.side-panel-header.compact {
  align-items: center;
}

.selected-agent-score {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.selected-agent-score p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.capability-stack {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.capability-stack > div {
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
}

.capability-stack svg {
  color: var(--primary);
}

.prompt-preview {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
}

.prompt-preview span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.prompt-preview p {
  max-height: 96px;
  overflow: auto;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.blueprint-list {
  display: grid;
  gap: 10px;
}

.blueprint-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.blueprint-body {
  min-width: 0;
}

.blueprint-body strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
}

.blueprint-body span {
  display: block;
  margin: 3px 0 8px;
  font-size: 12px;
  line-height: 1.5;
}

.market-card {
  border: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.market-card:hover {
  border-color: #bfdbfe !important;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .skill-hub-shell,
  .agent-dashboard-shell {
    padding: 0;
  }

  .automation-shell {
    padding: 12px;
  }

  .agent-dashboard-hero,
  .agent-dashboard-grid,
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .automation-hero,
  .automation-workspace {
    grid-template-columns: 1fr;
  }

  .automation-reference-strip,
  .automation-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .automation-toolbar,
  .automation-detail-head,
  .automation-run-row {
    align-items: stretch;
    flex-direction: column;
  }

  .automation-trigger-band {
    grid-template-columns: 1fr;
  }

  .agent-dashboard-hero-main,
  .agent-dashboard-live,
  .agent-market-workbench,
  .side-panel-card,
  .metric-tile {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .agent-dashboard-hero-main {
    min-height: auto;
    padding: 20px 16px;
  }

  .toolbar-controls {
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .workbench-toolbar {
    flex-direction: column;
  }

  .agent-op-grid {
    grid-template-columns: 1fr;
  }

  .agent-side-panel {
    position: static;
  }

  .agent-workbench {
    border-radius: 0;
    border: none;
  }

  .agent-chat-topbar {
    height: 48px;
    padding: 0 10px;
  }

  .agent-plaza-button {
    width: 34px;
    padding: 0;
  }

  .agent-topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .agent-topbar-title {
    max-width: 48vw;
  }

  .agent-chat-sidebar {
    display: none;
  }

  .artifact-compact-card {
    align-items: flex-start;
  }
}

.login-page { min-height: 100vh; display: flex; }
.login-brand-section { flex: 0 0 60%; background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); display: flex; flex-direction: column; justify-content: center; padding: 60px; position: relative; overflow: hidden; }
.login-brand-section::before { content: ''; position: absolute; top: -50%; right: -30%; width: 80%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%); }
.login-brand-title { font-size: 36px; font-weight: 700; color: #fff; margin-bottom: 16px; position: relative; z-index: 1; }
.login-brand-subtitle { font-size: 18px; color: rgba(255, 255, 255, 0.7); margin-bottom: 48px; position: relative; z-index: 1; }
.login-feature-card { background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; position: relative; z-index: 1; }
.login-feature-title { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.login-feature-desc { font-size: 14px; color: rgba(255, 255, 255, 0.7); }
.login-form-section { flex: 0 0 40%; background: var(--bg-card); display: flex; flex-direction: column; justify-content: center; padding: 60px; }
.login-form-title { font-size: 24px; font-weight: 600; color: var(--text-primary); margin-bottom: 32px; text-align: center; }
.user-select-card { border-radius: 12px; border: 1px solid var(--border-color); padding: 16px; cursor: pointer; display: flex; align-items: center; background: var(--bg-card); margin-bottom: 12px; }
.user-select-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.user-select-card .role-indicator { width: 4px; height: 48px; border-radius: 2px; margin-right: 16px; flex-shrink: 0; }
.user-select-card .role-indicator.admin { background: var(--accent-red); }
.user-select-card .role-indicator.manager { background: var(--primary); }
.user-select-card .role-indicator.member { background: var(--accent-green); }
.user-select-card .avatar-wrapper { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 16px; flex-shrink: 0; }
.user-select-card .avatar-wrapper.admin { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.user-select-card .avatar-wrapper.manager { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
.user-select-card .avatar-wrapper.member { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.user-select-card .user-info { flex: 1; }
.user-select-card .user-name { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.user-select-card .user-meta { font-size: 12px; color: var(--text-secondary); }

.loading-container { display: flex; justify-content: center; align-items: center; min-height: 200px; }
.empty-container { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 200px; color: var(--text-secondary); }

.process-architecture-shell {
  min-height: 100%;
  padding: 20px;
  background: #f6f7f9;
}

.process-architecture-loading {
  min-height: 420px;
  display: grid;
  place-items: center;
}

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

.process-architecture-header h3 {
  margin: 2px 0 0;
}

.process-stats {
  margin-bottom: 16px;
}

.process-architecture-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.process-tree-panel,
.process-ability-panel {
  min-height: 560px;
}

.process-tree-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.process-tree-title .ant-typography {
  font-size: 13px;
}

.process-ability-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.process-ability-toolbar h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.process-ability-toolbar .ant-input-affix-wrapper {
  width: 260px;
}

.process-ability-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.process-ability-columns section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.process-column-title {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #111827;
}

.process-ability-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.process-ability-card:hover {
  border-color: #2563eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.process-ability-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
}

.process-ability-icon.agent {
  background: #2563eb;
}

.process-ability-icon.skill {
  background: #0f766e;
}

.process-ability-icon.knowledge {
  background: #7c3aed;
}

.process-ability-body {
  min-width: 0;
}

.process-ability-body strong,
.process-ability-body span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-ability-body span {
  color: #6b7280;
  font-size: 12px;
}

.process-ability-body .ant-typography {
  color: #4b5563;
  font-size: 13px;
  margin: 6px 0 0;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .ant-layout-sider { position: fixed !important; z-index: 1000; }
  .login-page { flex-direction: column; }
  .login-brand-section { flex: none; padding: 40px 24px; }
  .login-brand-title { font-size: 28px; }
  .login-brand-subtitle { font-size: 16px; margin-bottom: 24px; }
  .login-feature-card { padding: 16px; }
  .login-form-section { flex: 1; padding: 32px 24px; }
  .page-header-title { font-size: 22px; }
  .ant-drawer-body { padding: 0 !important; }
  .ant-layout-content { margin: 0 !important; padding: 12px !important; }
  .agent-grid .ant-col { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  .chat-wrapper { height: calc(100vh - 56px) !important; }
  .process-architecture-grid,
  .process-ability-columns {
    grid-template-columns: 1fr;
  }
  .process-ability-toolbar {
    flex-direction: column;
  }
  .process-ability-toolbar .ant-input-affix-wrapper {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .ant-layout-content { padding: 8px !important; }
  .automation-reference-strip,
  .automation-metrics {
    grid-template-columns: 1fr;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease-out; }
.ant-card + .ant-card { margin-top: 16px; }
