/* ============================================
   17. REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .message { animation: none; }
  .typing-indicator span,
  .search-spinner { animation: none; }
  * { transition-duration: 0ms !important; }
}

/* ============================================
   18. AGENTS PAGE (Preserved)
   ============================================ */
.agents-page {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

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

.agents-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-gray-900);
}

.agents-subtitle {
  margin: 4px 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.agents-actions {
  display: flex;
  gap: 8px;
}

.agent-category { margin-bottom: 32px; }

.category-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}

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

.agent-card-admin {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.agent-card-admin:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-500);
}

.agent-card-header-admin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.agent-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.agent-source-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.agent-source-badge.submodule { background: #eff6ff; color: #3b82f6; }
.agent-source-badge.custom { background: #f0fdf4; color: #16a34a; }

.agent-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0 0 6px;
}

.agent-desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin: 0 0 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.agent-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.agent-meta-item {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-gray-100);
  color: var(--color-text-secondary);
}

.agent-enabled { background: #f0fdf4; color: #16a34a; }
.agent-disabled { background: #fef2f2; color: #ef4444; }
.agent-card-actions { display: flex; gap: 6px; }

/* ============================================
   19. BUTTONS & FORMS (Preserved)
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
  font-family: var(--font-sans);
}

.btn-primary { background: var(--color-primary-500); color: #fff; }
.btn-primary:hover { background: var(--color-primary-600); }
.btn-secondary { background: var(--color-white); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-gray-50); border-color: var(--color-text-muted); }
.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 4px 10px; font-size: var(--text-xs); }

/* ============================================
   18A. FLASH MESSAGES
   ============================================ */
.flash-container {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.flash-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--flash-border);
  border-radius: var(--radius-md);
  background: var(--flash-bg);
  color: var(--flash-text);
  box-shadow: 0 18px 42px rgb(15 23 42 / 0.16), var(--shadow-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.45;
  pointer-events: auto;
}

.flash-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--flash-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.flash-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.flash-notice {
  --flash-bg: #ecfdf5;
  --flash-border: #a7f3d0;
  --flash-text: #065f46;
  --flash-accent: var(--color-success);
}

.flash-alert {
  --flash-bg: #fef2f2;
  --flash-border: #fecaca;
  --flash-text: #991b1b;
  --flash-accent: var(--color-error);
}

